* elmo-imap4.el (elmo-imap4-send-command): If BYE response is detected,
authorteranisi <teranisi>
Thu, 1 Nov 2001 01:28:09 +0000 (01:28 +0000)
committerteranisi <teranisi>
Thu, 1 Nov 2001 01:28:09 +0000 (01:28 +0000)
delete process.
(elmo-imap4-accept-ok): Ditto.

elmo/ChangeLog
elmo/elmo-imap4.el

index 86f4521..a7b9859 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-01  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-imap4.el (elmo-imap4-send-command): If BYE response is detected,
+       delete process.
+       (elmo-imap4-accept-ok): Ditto.
+
 2001-10-25  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * mmimap.el (mime-imap-entity-header-string): Don't check first
index f9e64b2..0c2be18 100644 (file)
@@ -248,7 +248,7 @@ If response is not `OK', causes error with IMAP response text."
 
 (defun elmo-imap4-send-command (session command)
   "Send COMMAND to the SESSION.
-Returns a TAG string which is assigned to the COMAND."
+Returns a TAG string which is assigned to the COMMAND."
   (let* ((command-args (if (listp command)
                           command
                         (list command)))
@@ -261,10 +261,11 @@ Returns a TAG string which is assigned to the COMAND."
       (setq cmdstr (concat tag " "))
       ;; (erase-buffer) No need.
       (goto-char (point-min))
-      (if (elmo-imap4-response-bye-p elmo-imap4-current-response)
-         (signal 'elmo-imap4-bye-error
-                 (list (elmo-imap4-response-error-text
-                        elmo-imap4-current-response))))
+      (when (elmo-imap4-response-bye-p elmo-imap4-current-response)
+       (elmo-network-close-session session)
+       (signal 'elmo-imap4-bye-error
+               (list (elmo-imap4-response-error-text
+                      elmo-imap4-current-response))))
       (setq elmo-imap4-current-response nil)
       (if elmo-imap4-parsing
          (error "IMAP process is running. Please wait (or plug again.)"))
@@ -376,8 +377,10 @@ If response is not `OK' response, causes error with IMAP response text."
     (if (elmo-imap4-response-ok-p response)
        response
       (if (elmo-imap4-response-bye-p response)
-         (signal 'elmo-imap4-bye-error
-                 (list (elmo-imap4-response-error-text response)))
+         (progn
+           (elmo-network-close-session session)
+           (signal 'elmo-imap4-bye-error
+                   (list (elmo-imap4-response-error-text response))))
        (error "IMAP error: %s"
               (or (elmo-imap4-response-error-text response)
                   "No `OK' response from server."))))))