2002-01-07 Kenichi OKADA <okada@opaopa.org>
+ * elmo-nntp.el (elmo-nntp-read-response): Added `error-msg' argument.
+ Change to looking-at `[23][0-9]+'.
+ (elmo-network-initialize-session): Use 'error-msg'
+ * elmo-net.el (elmo-network-open-session): Set unplugged
+ if elmo-network-initialize-session returns 'elmo-open-err.
+
+2002-01-07 Kenichi OKADA <okada@opaopa.org>
+
* elmo-version.el (elmo-version): Up to 2.9.4.
2002-01-07 Yuuichi Teranishi <teranisi@gohome.org>
(elmo-network-authenticate-session session)
(elmo-network-setup-session session)))
(error
+ (when (eq (car error) 'elmo-open-error)
+ (elmo-set-plugged nil server port
+ (elmo-network-stream-type-symbol stream-type)
+ (current-time))
+ (message "Auto plugged off at %s:%d :%s" server port (cadr error))
+ (sit-for 1))
(when (eq (car error) 'elmo-authenticate-error)
(elmo-remove-passwd (elmo-network-session-password-key session)))
(elmo-network-close-session session)
(luna-define-method elmo-network-initialize-session ((session
elmo-nntp-session))
- (let ((process (elmo-network-session-process-internal session)))
+ (let ((process (elmo-network-session-process-internal session))
+ response)
(set-process-filter (elmo-network-session-process-internal session)
'elmo-nntp-process-filter)
(with-current-buffer (elmo-network-session-buffer session)
(not (looking-at "^[2-5][0-9][0-9]")))
(accept-process-output process 1))
(setq elmo-nntp-read-point (point))
- (or (elmo-nntp-read-response session t)
- (error "Cannot open network"))
+ (setq response (elmo-nntp-read-response session t t))
+ (unless (car response)
+ (signal 'elmo-open-error (list (cdr response))))
(if elmo-nntp-send-mode-reader
(elmo-nntp-send-mode-reader session))
(when (eq (elmo-network-stream-type-symbol
(process-send-string (elmo-network-session-process-internal
session) "\r\n")))
-(defun elmo-nntp-read-response (session &optional not-command)
+(defun elmo-nntp-read-response (session &optional not-command error-msg)
(with-current-buffer (elmo-network-session-buffer session)
(let ((process (elmo-network-session-process-internal session))
(case-fold-search nil)
(setq response-string
(buffer-substring elmo-nntp-read-point (- match-end 2)))
(goto-char elmo-nntp-read-point)
- (if (looking-at "[234][0-9]+ .*$")
+ (if (looking-at "[23][0-9]+ .*$")
(progn (setq response-continue nil)
(setq elmo-nntp-read-point match-end)
(setq response
(if response
(concat response "\n" response-string)
response-string)))
- (if (looking-at "[^234][0-9]+ .*$")
+ (if (looking-at "[^23][0-9]+ .*$")
(progn (setq response-continue nil)
(setq elmo-nntp-read-point match-end)
(setq response nil))
(concat response "\n" response-string)
response-string)))
(setq elmo-nntp-read-point match-end)))
- response)))
+ (if error-msg
+ (cons response response-string)
+ response))))
(defun elmo-nntp-read-raw-response (session)
(with-current-buffer (elmo-network-session-buffer session)