Synch with wl-2_4.
authorteranisi <teranisi>
Wed, 22 Nov 2000 11:28:09 +0000 (11:28 +0000)
committerteranisi <teranisi>
Wed, 22 Nov 2000 11:28:09 +0000 (11:28 +0000)
elmo/ChangeLog
elmo/elmo-net.el
elmo/elmo-pop3.el
elmo/elmo-version.el
wl/ChangeLog

index ecfe1cd..9ac841f 100644 (file)
@@ -1,3 +1,25 @@
+2000-11-22  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-version.el (elmo-version): Up to 2.5.3.
+
+       * elmo-net.el (elmo-network-get-session): Changed logic for
+       checking process status.
+
+       * elmo-pop3.el (elmo-network-close-session): Do nothing if session
+       process is nil;
+       Changed logic for checking process status.
+
+2000-11-20  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-pop3.el (elmo-network-initialize-session): Skip garbage output
+       before greeting.
+       (elmo-network-setup-session): Set UIDL hash size according to
+       the length of list response.
+       (elmo-pop3-parse-list-response): Setup elmo-pop3-size-hash
+       according to the length of list response;
+       Return the length of list response.
+       (Adviced by OKAZAKI Tetsurou <okazaki@be.to>)
+
 2000-11-21  Kenichi OKADA  <okada@opaopa.org>
 
        * elmo-imap4.el (toplevel): Require 'ssl.
index 57b7e85..f283b2a 100644 (file)
@@ -137,10 +137,10 @@ if making session failed, returns nil."
                                 name host port user auth stream-type))
                      elmo-network-session-cache))
     (when (and pair
-              (memq (process-status
-                     (elmo-network-session-process-internal
-                      (cdr pair)))
-                    '(closed exit)))
+              (not (memq (process-status
+                          (elmo-network-session-process-internal
+                           (cdr pair)))
+                         '(open run))))
       (setq elmo-network-session-cache
            (delq pair elmo-network-session-cache))
       (elmo-network-close-session (cdr pair))
index 8df3c76..8e15d5a 100644 (file)
                                    elmo-pop3-list-done))
 
 (luna-define-method elmo-network-close-session ((session elmo-pop3-session))
-  (unless (memq (process-status
+  (when (elmo-network-session-process-internal session)
+    (when (memq (process-status
                 (elmo-network-session-process-internal session))
-               '(closed exit))
-    (elmo-pop3-send-command (elmo-network-session-process-internal session)
-                           "quit")
-    (or (elmo-pop3-read-response
-        (elmo-network-session-process-internal session) t)
-       (error "POP error: QUIT failed")))
-  (kill-buffer (process-buffer
-               (elmo-network-session-process-internal session)))
-  (delete-process (elmo-network-session-process-internal session)))
+               '(open run))
+      (elmo-pop3-send-command (elmo-network-session-process-internal session)
+                             "quit")
+      (or (elmo-pop3-read-response
+          (elmo-network-session-process-internal session) t)
+         (error "POP error: QUIT failed")))
+    (kill-buffer (process-buffer
+                 (elmo-network-session-process-internal session)))
+    (delete-process (elmo-network-session-process-internal session))))
 
 (defun elmo-pop3-get-session (spec &optional if-exists)
   (elmo-network-get-session
                (setq return-value nil))
            (setq elmo-pop3-read-point match-end)
            (if not-command
-               (setq response-continue nil))
+               (setq response-continue nil))
            (setq return-value
                  (if return-value
                      (concat return-value "\n" response-string)
     (with-current-buffer (process-buffer process)
       (set-process-filter process 'elmo-pop3-process-filter)
       (setq elmo-pop3-read-point (point-min))
+      ;; Skip garbage output from process before greeting.
+      (while (and (memq (process-status process) '(open run))
+                 (goto-char (point-max))
+                 (forward-line -1)
+                 (not (looking-at "+OK")))
+       (accept-process-output process 1))
+      (setq elmo-pop3-read-point (point))
       (or (elmo-network-session-set-greeting-internal
           session
           (elmo-pop3-read-response process t))
 (luna-define-method elmo-network-setup-session ((session
                                                 elmo-pop3-session))
   (let ((process (elmo-network-session-process-internal session))
-       response)
+       count response)
     (with-current-buffer (process-buffer process)
-      (setq elmo-pop3-size-hash (make-vector 31 0))
+      (setq elmo-pop3-size-hash (elmo-make-hash 31))
       ;; To get obarray of uidl and size
       (elmo-pop3-send-command process "list")
       (if (null (elmo-pop3-read-response process))
-         (error "POP List folder failed"))
+         (error "POP LIST command failed"))
       (if (null (setq response
                      (elmo-pop3-read-contents
                       (current-buffer) process)))
-         (error "POP List folder failed"))
+         (error "POP LIST command failed"))
       ;; POP server always returns a sequence of serial numbers.
-      (elmo-pop3-parse-list-response response)
+      (setq count (elmo-pop3-parse-list-response response))
       ;; UIDL
       (when elmo-pop3-use-uidl
-       (setq elmo-pop3-uidl-number-hash (make-vector 31 0))
-       (setq elmo-pop3-number-uidl-hash (make-vector 31 0))
+       (setq elmo-pop3-uidl-number-hash (elmo-make-hash (* count 2)))
+       (setq elmo-pop3-number-uidl-hash (elmo-make-hash (* count 2)))
        ;; UIDL
        (elmo-pop3-send-command process "uidl")
        (unless (elmo-pop3-read-response process)
-         (error "UIDL failed"))
+         (error "POP UIDL failed"))
        (unless (setq response (elmo-pop3-read-contents
                                (current-buffer) process))
-         (error "UIDL failed"))
+         (error "POP UIDL failed"))
        (elmo-pop3-parse-uidl-response response)))))
 
 (defun elmo-pop3-read-contents (buffer process)
 
 (defun elmo-pop3-parse-list-response (string)
   (let ((buffer (current-buffer))
-       number list size)
+       (count 0)
+       alist)
     (with-temp-buffer
       (insert string)
       (goto-char (point-min))
       (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([0-9]+\\)$" nil t)
-       (setq list
+       (setq alist
              (cons
-              (string-to-int (setq number (elmo-match-buffer 1)))
-              list))
-       (setq size (elmo-match-buffer 2))
-       (with-current-buffer buffer
-         (elmo-set-hash-val (concat "#" number)
-                            size
-                            elmo-pop3-size-hash)))
-      (with-current-buffer buffer (setq elmo-pop3-list-done t))
-      (nreverse list))))
+              (cons (elmo-match-buffer 1)
+                    (elmo-match-buffer 2))
+              alist))
+       (setq count (1+ count)))
+      (with-current-buffer buffer
+       (setq elmo-pop3-size-hash (elmo-make-hash (* (length alist) 2)))
+       (while alist
+         (elmo-set-hash-val (concat "#" (car (car alist)))
+                            (cdr (car alist))
+                            elmo-pop3-size-hash)
+         (setq alist (cdr alist)))
+       (setq elmo-pop3-list-done t))
+      count)))
 
 (defun elmo-pop3-list-location (spec)
   (with-current-buffer (process-buffer
index 2ef7746..68f1e8c 100644 (file)
@@ -35,7 +35,7 @@
 
 ;; product-define in the first place
 (product-provide 'elmo-version
-  (product-define "ELMO" nil '(2 5 2)))
+  (product-define "ELMO" nil '(2 5 3)))
 
 ;; For APEL 10.2 or earlier.
 (defun-maybe product-version-as-string (product)
index ca1db75..55fc085 100644 (file)
@@ -1,5 +1,11 @@
 2000-11-22  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * Version number is increased to 2.5.3.
+
+       * wl-draft.el (wl-draft-smtp-send-buffer): New function
+       (for compatibility).
+       (wl-draft-send-mail-with-smtp): Use it.
+
        * wl-summary.el (wl-summary-save-view-cache):
        Delete duplicated `write-region';
        Use `write-region-as-binary' instead of `as-binary-output-file' and