+2001-06-18 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-pop3.el (elmo-network-close-session): Removed 3rd argument.
+ (elmo-network-setup-session): Ditto.
+ (elmo-message-fetch-plugged): Ditto.
+ (elmo-pop3-send-command): Don't call elmo-pop3-lock.
+ (elmo-network-initialize-session): Ditto.
+ (elmo-pop3-read-response): Abolish 3rd argument.
+ (elmo-pop3-read-response): Don't call elmo-pop3-unlock.
+ (elmo-pop3-read-contents): Ditto.
+ (elmo-pop3-read-body): Ditto.
+ (elmo-pop3-max-of-folder): Call elmo-pop3-commit.
+ (elmo-pop3-lock): Abolish.
+ (elmo-pop3-unlock): Ditto.
+ (elmo-pop3-locked-p): Ditto.
+ (elmo-folder-check): Don't call elmo-pop3-locked-p.
+
2001-06-15 Yuuichi Teranishi <teranisi@gohome.org>
* elmo-version.el (elmo-version): Up to 2.6.0.
(defvar elmo-pop3-size-hash nil) ; number -> size
(defvar elmo-pop3-uidl-done nil)
(defvar elmo-pop3-list-done nil)
-(defvar elmo-pop3-lock nil)
(defvar elmo-pop3-local-variables '(elmo-pop3-read-point
elmo-pop3-uidl-number-hash
elmo-pop3-number-uidl-hash
elmo-pop3-uidl-done
elmo-pop3-size-hash
- elmo-pop3-list-done
- elmo-pop3-lock))
+ elmo-pop3-list-done))
(luna-define-method elmo-network-close-session ((session elmo-pop3-session))
(when (elmo-network-session-process-internal session)
(erase-buffer))
(goto-char (point-min))
(setq elmo-pop3-read-point (point))
- (elmo-pop3-lock)
(elmo-pop3-debug "SEND: %s\n" command)
(process-send-string process command)
(process-send-string process "\r\n")))
-(defun elmo-pop3-read-response (process &optional not-command keep-lock)
+(defun elmo-pop3-read-response (process &optional not-command)
(with-current-buffer (process-buffer process)
(let ((case-fold-search nil)
(response-string nil)
(concat return-value "\n" response-string)
response-string)))
(setq elmo-pop3-read-point match-end)))
- (unless keep-lock
- (elmo-pop3-unlock))
return-value)))
(defun elmo-pop3-process-filter (process output)
(let ((process (elmo-network-session-process-internal session))
response mechanism)
(with-current-buffer (process-buffer process)
- (elmo-pop3-lock)
(set-process-filter process 'elmo-pop3-process-filter)
(setq elmo-pop3-read-point (point-min))
;; Skip garbage output from process before greeting.
(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 nil 'keep-lock))
+ (if (null (elmo-pop3-read-response process))
(error "POP LIST command failed"))
(if (null (setq response
(elmo-pop3-read-contents
(setq elmo-pop3-number-uidl-hash (elmo-make-hash (* count 2)))
;; UIDL
(elmo-pop3-send-command process "uidl")
- (unless (elmo-pop3-read-response process nil 'keep-lock)
+ (unless (elmo-pop3-read-response process)
(error "POP UIDL failed"))
(unless (setq response (elmo-pop3-read-contents
(current-buffer) process))
(accept-process-output process)
(goto-char elmo-pop3-read-point))
(setq match-end (point))
- (elmo-pop3-unlock)
(elmo-delete-cr
(buffer-substring elmo-pop3-read-point
(- match-end 3))))))
(defun elmo-pop3-max-of-folder (spec)
(elmo-pop3-commit spec)
(if elmo-pop3-use-uidl
- (elmo-pop3-list-by-uidl-subr spec 'nonsort)
+ (prog1
+ (elmo-pop3-list-by-uidl-subr spec 'nonsort)
+ (elmo-pop3-commit spec))
(let* ((process
(elmo-network-session-process-internal
(elmo-pop3-get-session spec)))
(setq total
(string-to-int
(substring response (match-beginning 1)(match-end 1 ))))
+ (elmo-pop3-commit spec)
(cons total total))))))
(defvar elmo-pop3-header-fetch-chop-length 200)
(t
nil)))
-(defun elmo-pop3-lock ()
- "Lock pop3 process."
- (setq elmo-pop3-lock t))
-
-(defun elmo-pop3-unlock ()
- "Unlock pop3 process."
- (setq elmo-pop3-lock nil))
-
-(defun elmo-pop3-locked-p (process)
- "Return t if pop3 PROCESS is locked."
- (with-current-buffer (process-buffer process)
- (if elmo-pop3-lock
- (progn
- (elmo-pop3-debug "POP3 is LOCKED!")
- t)
- nil)))
-
(defun elmo-pop3-retrieve-headers (buffer tobuffer process articles)
(save-excursion
(set-buffer buffer)
(accept-process-output process)
(goto-char start))
(setq end (point))
- (elmo-pop3-unlock)
(with-current-buffer outbuf
(erase-buffer)
(insert-buffer-substring (process-buffer process) start (- end 3))
(unwind-protect
(progn
(when (null (setq response (elmo-pop3-read-response
- process t 'keep-lock)))
+ process t)))
(error "Fetching message failed"))
(setq response (elmo-pop3-read-body process outbuf)))
(setq elmo-pop3-total-size nil))
(defun elmo-pop3-commit (spec)
(if (elmo-pop3-plugged-p spec)
(let ((session (elmo-pop3-get-session spec 'if-exists)))
- (when (and session
- (not (elmo-pop3-locked-p
- (elmo-network-session-process-internal session))))
+ (when session
(elmo-network-close-session session)))))
-
(require 'product)
(product-provide (provide 'elmo-pop3) (require 'elmo-version))
(defun wl-biff-check-folder (folder)
(if (eq (elmo-folder-get-type folder) 'pop3)
- ;; pop3 biff should share the session.
- (prog2
- (elmo-commit folder) ; Close session.
- (wl-folder-check-one-entity folder)
- (elmo-commit folder))
+ (unless (elmo-pop3-get-session (elmo-folder-get-spec folder) 'if-exists)
+ ;; Currently no main pop3 process.
+ (let ((elmo-network-session-name-prefix "BIFF-"))
+ (wl-folder-check-one-entity folder)))
(let ((elmo-network-session-name-prefix "BIFF-"))
(wl-folder-check-one-entity folder))))
notify-minibuf))
(let ((elmo-network-session-name-prefix "BIFF-"))
(elmo-folder-diff-async folder)))
- (wl-biff-notify (car (wl-biff-check-folder folder))
- notify-minibuf)
- (setq wl-biff-check-folders-running nil)))))
+ (unwind-protect
+ (wl-biff-notify (car (wl-biff-check-folder folder))
+ notify-minibuf)
+ (setq wl-biff-check-folders-running nil))))))
(if (and (fboundp 'regexp-opt)
(not (featurep 'xemacs)))