* elmo-imap4.el (elmo-network-authenticate-session): Fixed a logic for
authorteranisi <teranisi>
Fri, 22 Dec 2000 06:02:36 +0000 (06:02 +0000)
committerteranisi <teranisi>
Fri, 22 Dec 2000 06:02:36 +0000 (06:02 +0000)
 response checking.

elmo/ChangeLog
elmo/elmo-imap4.el

index 832f9e7..8524ff1 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-22  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-imap4.el (elmo-network-authenticate-session):
+       Fixed a logic for response checking.
+
 2000-12-15   Daiki Ueno  <ueno@unixuser.org>
 
        * elmo-net.el: Add autoload settings for `starttls-negotiate',
index 96a9a12..bb603c6 100644 (file)
@@ -1242,17 +1242,24 @@ If optional argument UNMARK is non-nil, unmark."
                                  'no-lin-break)))))) ;)
            (catch 'done
              (while t
-               (setq response (elmo-imap4-read-untagged
-                               (elmo-network-session-process-internal session)))
-               (if (and
-                    (null (elmo-imap4-response-continue-req-p response))
-                    (elmo-imap4-response-ok-p response)
-                    (or (sasl-next-step client step)
-                        (throw 'done nil)))
+               (setq response
+                     (elmo-imap4-read-untagged
+                      (elmo-network-session-process-internal session)))
+               (if (elmo-imap4-response-continue-req-p response)
+                   (unless (sasl-next-step client step)
+                     ;; response is '+' but there's no next step.
+                     (signal 'elmo-authenticate-error
+                             (list (intern
+                                    (concat "elmo-imap4-auth-"
+                                            (downcase name))))))
+                 ;; response is OK.
+                 (if (elmo-imap4-response-ok-p response)
+                     (throw 'done nil) ; finished.
+                   ;; response is NO or BAD.
                    (signal 'elmo-authenticate-error
                            (list (intern
                                   (concat "elmo-imap4-auth-"
-                                          (downcase name))))))
+                                          (downcase name)))))))
                (sasl-step-set-data
                 step
                 (elmo-base64-decode-string