Wait for the continuation line before sending anything unless we're streaming.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 31 Oct 2010 22:18:57 +0000 (23:18 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 31 Oct 2010 22:18:57 +0000 (23:18 +0100)
lisp/ChangeLog
lisp/nnimap.el

index 9c59f13..71a4a3d 100644 (file)
@@ -2,6 +2,9 @@
 
        * nnimap.el (nnimap-request-accept-article): Erase buffer before
        appending for easier debugging.
+       (nnimap-wait-for-connection): Take a regexp.
+       (nnimap-request-accept-article): Wait for the continuation line before
+       sending anything unless we're streaming.
 
        * gnus-art.el (gnus-treat-article): Only inhibit body washing, and
        leave the header washing to take place.
index 3ecee73..26dac5c 100644 (file)
@@ -934,6 +934,8 @@ textual parts.")
        (setq sequence (nnimap-send-command
                        "APPEND %S {%d}" (utf7-encode group t)
                        (length message)))
+       (unless nnimap-streaming
+         (nnimap-wait-for-connection "^[+]"))
        (process-send-string (get-buffer-process (current-buffer)) message)
        (process-send-string (get-buffer-process (current-buffer))
                             (if (nnimap-newlinep nnimap-object)
@@ -1480,12 +1482,14 @@ textual parts.")
   (nnimap-wait-for-response sequence)
   (nnimap-parse-response))
 
-(defun nnimap-wait-for-connection ()
+(defun nnimap-wait-for-connection (regexp)
+  (unless regexp
+    (setq regexp "^[*.] .*\n"))
   (let ((process (get-buffer-process (current-buffer))))
     (goto-char (point-min))
     (while (and (memq (process-status process)
                      '(open run))
-               (not (re-search-forward "^[*.] .*\n" nil t)))
+               (not (re-search-forward regexp nil t)))
       (nnheader-accept-process-output process)
       (goto-char (point-min)))
     (forward-line -1)