X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnntp.el;h=d7665b5ed8c3a6ffdd51b4c726776e49efe5155a;hb=61b61ec93653e00c477df0bad2f7a33eb101adf6;hp=487c72d218ecf421fbaba9841837180c719529e8;hpb=37b7cc19618900d290af35abd0fe6c53db8fbdc2;p=elisp%2Fgnus.git- diff --git a/lisp/nntp.el b/lisp/nntp.el index 487c72d..d7665b5 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -30,10 +30,6 @@ (nnoo-declare nntp) -(eval-and-compile - (unless (fboundp 'open-network-stream) - (require 'tcp))) - (eval-when-compile (require 'cl)) (defvoo nntp-address nil @@ -154,12 +150,6 @@ server there that you can connect to. See also (defvoo nntp-warn-about-losing-connection t "*If non-nil, beep when a server closes connection.") -(defvoo nntp-coding-system-for-read 'binary - "*Coding system to read from NNTP.") - -(defvoo nntp-coding-system-for-write 'binary - "*Coding system to write to NNTP.") - (defcustom nntp-authinfo-file "~/.authinfo" ".netrc-like file that holds nntp authinfo passwords." :type @@ -652,7 +642,7 @@ If this variable is nil, which is the default, no timers are set.") (deffoo nntp-request-group (group &optional server dont-check) (nntp-possibly-change-group nil server) - (when (nntp-send-command "^21.*\n" "GROUP" group) + (when (nntp-send-command "^[245].*\n" "GROUP" group) (let ((entry (nntp-find-connection-entry nntp-server-buffer))) (setcar (cddr entry) group)))) @@ -847,9 +837,7 @@ password contained in '~/.nntp-authinfo'." (kill-buffer ,pbuffer)))))) (process (condition-case () - (let ((coding-system-for-read nntp-coding-system-for-read) - (coding-system-for-write nntp-coding-system-for-write)) - (funcall nntp-open-connection-function pbuffer)) + (funcall nntp-open-connection-function pbuffer) (error nil) (quit nil)))) (when timer @@ -875,7 +863,8 @@ password contained in '~/.nntp-authinfo'." nil)))) (defun nntp-open-network-stream (buffer) - (open-network-stream "nntpd" buffer nntp-address nntp-port-number)) + (open-network-stream-as-binary + "nntpd" buffer nntp-address nntp-port-number)) (defun nntp-open-ssl-stream (buffer) (let* ((ssl-program-arguments '("-connect" (concat host ":" service))) @@ -979,7 +968,9 @@ password contained in '~/.nntp-authinfo'." (set-buffer (process-buffer (car entry))) (erase-buffer) (nntp-send-string (car entry) (concat "GROUP " group)) - (nntp-wait-for-string "^2.*\n") + ;; allow for unexpected responses, since this can be called + ;; from a timer with quit inhibited + (nntp-wait-for-string "^[245].*\n") (setcar (cddr entry) group) (erase-buffer)))))) @@ -1172,9 +1163,10 @@ password contained in '~/.nntp-authinfo'." (save-excursion (set-buffer buffer) (erase-buffer) - (let ((proc (apply - 'start-process - "nntpd" buffer nntp-telnet-command nntp-telnet-switches)) + (let ((proc (as-binary-process + (apply + 'start-process + "nntpd" buffer nntp-telnet-command nntp-telnet-switches))) (case-fold-search t)) (when (memq (process-status proc) '(open run)) (process-send-string proc "set escape \^X\n") @@ -1219,13 +1211,15 @@ password contained in '~/.nntp-authinfo'." (defun nntp-open-rlogin (buffer) "Open a connection to SERVER using rsh." (let ((proc (if nntp-rlogin-user-name - (apply 'start-process - "nntpd" buffer nntp-rlogin-program - nntp-address "-l" nntp-rlogin-user-name - nntp-rlogin-parameters) - (apply 'start-process - "nntpd" buffer nntp-rlogin-program nntp-address - nntp-rlogin-parameters)))) + (as-binary-process + (apply 'start-process + "nntpd" buffer nntp-rlogin-program + nntp-address "-l" nntp-rlogin-user-name + nntp-rlogin-parameters)) + (as-binary-process + (apply 'start-process + "nntpd" buffer nntp-rlogin-program nntp-address + nntp-rlogin-parameters))))) (save-excursion (set-buffer buffer) (nntp-wait-for-string "^\r*20[01]")