+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-folder-status): Call elmo-folder-close.
+ (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.7.0.
;; process is dead.
(or (elmo-pop3-read-response
(elmo-network-session-process-internal session)
- t buffer)
+ t)
(error "POP error: QUIT failed"))))
(kill-buffer (process-buffer
(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)
;; buffer is in case for process is dead.
(with-current-buffer (process-buffer process)
(let ((case-fold-search 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))))))
(luna-define-method elmo-folder-status ((folder elmo-pop3-folder))
(elmo-folder-check folder)
(if (elmo-pop3-folder-use-uidl-internal folder)
- (elmo-pop3-list-by-uidl-subr folder 'nonsort)
+ (prog1
+ (elmo-pop3-list-by-uidl-subr folder 'nonsort)
+ (elmo-folder-close folder))
(let* ((process
(elmo-network-session-process-internal
(elmo-pop3-get-session folder)))
(setq total
(string-to-int
(substring response (match-beginning 1)(match-end 1 ))))
+ (elmo-folder-close folder)
(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))
(luna-define-method elmo-folder-check ((folder elmo-pop3-folder))
(if (elmo-folder-plugged-p folder)
(let ((session (elmo-pop3-get-session folder 'if-exists)))
- (when (and session
- (not (elmo-pop3-locked-p
- (elmo-network-session-process-internal session))))
+ (when session
(elmo-pop3-folder-set-location-alist-internal folder nil)
(elmo-network-close-session session)))))
(defun wl-biff-check-folder (folder)
(if (eq (elmo-folder-type-internal folder) 'pop3)
- ;; pop3 biff should share the session.
- (prog2
- (elmo-folder-check folder)
- (wl-folder-check-one-entity (elmo-folder-name-internal folder))
- (elmo-folder-close folder))
+ (unless (elmo-pop3-get-session folder 'if-exists)
+ ;; Currently no main pop3 process.
+ (let ((elmo-network-session-name-prefix "BIFF-"))
+ (wl-folder-check-one-entity
+ (elmo-folder-name-internal folder))))
(let ((elmo-network-session-name-prefix "BIFF-"))
(wl-folder-check-one-entity (elmo-folder-name-internal 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)))