(spam-report-url-ping-plain): Wait for output to avoid
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 1 Dec 2006 17:02:50 +0000 (17:02 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 1 Dec 2006 17:02:50 +0000 (17:02 +0000)
DOS-ing the recipient.

lisp/ChangeLog
lisp/spam-report.el

index f4dbd86..1a60710 100644 (file)
@@ -1,5 +1,8 @@
 2006-12-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * spam-report.el (spam-report-url-ping-plain): Wait for output to avoid
+       DOS-ing the recipient.
+
        * nnweb.el (nnweb-gmane-create-mapping): Use the article number from
        the headers when creating the mapping to avoid mismappings. 
        (nnweb-gmane-create-mapping): Always nix out old mapping.
index 557dd8f..ad4b914 100644 (file)
@@ -129,6 +129,7 @@ Reports is as ham when HAM is set."
   "Report ARTICLES as spam through Gmane."
   (interactive (gnus-summary-work-articles current-prefix-arg))
   (dolist (article articles)
+    (message "Reporting %s" article)
     (spam-report-gmane-internal nil article)))
 
 ;; `spam-report-gmane' was an interactive entry point, so we should provide an
@@ -224,7 +225,11 @@ This is initialized based on `user-mail-address'."
       (process-send-string
        tcp-connection
        (format "GET %s HTTP/1.1\nUser-Agent: %s\nHost: %s\n\n"
-              report spam-report-user-agent host)))))
+              report spam-report-user-agent host))
+      ;; Wait until we get something so we don't DOS the host. 
+      (while (and (memq (process-status tcp-connection) '(open run))
+                 (zerop (buffer-size)))
+       (accept-process-output tcp-connection)))))
 
 ;;;###autoload
 (defun spam-report-process-queue (&optional file keep)