diff options
| author | Stefan Monnier | 2007-08-23 18:36:07 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-08-23 18:36:07 +0000 |
| commit | 8d559559ce2af88493855cf3a46b299b46ef0846 (patch) | |
| tree | ae53edf93f28d41178669b964da755ffd31d0ca3 | |
| parent | 67d0660b15f4e7d716881ac5b9192a1a17c4e4f9 (diff) | |
| download | emacs-8d559559ce2af88493855cf3a46b299b46ef0846.tar.gz emacs-8d559559ce2af88493855cf3a46b299b46ef0846.zip | |
(socks-username/password-auth-filter):
Remove unused vars `state' and `desired-len'.
(socks-parse-services, socks-nslookup-host): Use with-current-buffer.
(socks-wait-for-state-change): Use new-style backquotes.
| -rw-r--r-- | lisp/net/socks.el | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lisp/net/socks.el b/lisp/net/socks.el index 72f6b03570b..5a2364c652c 100644 --- a/lisp/net/socks.el +++ b/lisp/net/socks.el | |||
| @@ -263,10 +263,9 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." | |||
| 263 | (defconst socks-state-connected 4) | 263 | (defconst socks-state-connected 4) |
| 264 | 264 | ||
| 265 | (defmacro socks-wait-for-state-change (proc htable cur-state) | 265 | (defmacro socks-wait-for-state-change (proc htable cur-state) |
| 266 | (` | 266 | `(while (and (= (gethash 'state ,htable) ,cur-state) |
| 267 | (while (and (= (gethash 'state (, htable)) (, cur-state)) | 267 | (memq (process-status ,proc) '(run open))) |
| 268 | (memq (process-status (, proc)) '(run open))) | 268 | (accept-process-output ,proc socks-timeout))) |
| 269 | (accept-process-output (, proc) socks-timeout)))) | ||
| 270 | 269 | ||
| 271 | (defun socks-filter (proc string) | 270 | (defun socks-filter (proc string) |
| 272 | (let ((info (gethash proc socks-connections)) | 271 | (let ((info (gethash proc socks-connections)) |
| @@ -493,10 +492,9 @@ version.") | |||
| 493 | (if (not (and (file-exists-p socks-services-file) | 492 | (if (not (and (file-exists-p socks-services-file) |
| 494 | (file-readable-p socks-services-file))) | 493 | (file-readable-p socks-services-file))) |
| 495 | (error "Could not find services file: %s" socks-services-file)) | 494 | (error "Could not find services file: %s" socks-services-file)) |
| 496 | (save-excursion | 495 | (clrhash socks-tcp-services) |
| 497 | (clrhash socks-tcp-services) | 496 | (clrhash socks-udp-services) |
| 498 | (clrhash socks-udp-services) | 497 | (with-current-buffer (get-buffer-create " *socks-tmp*") |
| 499 | (set-buffer (get-buffer-create " *socks-tmp*")) | ||
| 500 | (erase-buffer) | 498 | (erase-buffer) |
| 501 | (insert-file-contents socks-services-file) | 499 | (insert-file-contents socks-services-file) |
| 502 | ;; Nuke comments | 500 | ;; Nuke comments |
| @@ -566,10 +564,8 @@ version.") | |||
| 566 | (defconst socks-username/password-auth-version 1) | 564 | (defconst socks-username/password-auth-version 1) |
| 567 | 565 | ||
| 568 | (defun socks-username/password-auth-filter (proc str) | 566 | (defun socks-username/password-auth-filter (proc str) |
| 569 | (let ((info (gethash proc socks-connections)) | 567 | (let ((info (gethash proc socks-connections))) |
| 570 | state desired-len) | ||
| 571 | (or info (error "socks-filter called on non-SOCKS connection %S" proc)) | 568 | (or info (error "socks-filter called on non-SOCKS connection %S" proc)) |
| 572 | (setq state (gethash 'state info)) | ||
| 573 | (puthash 'scratch (concat (gethash 'scratch info) str) info) | 569 | (puthash 'scratch (concat (gethash 'scratch info) str) info) |
| 574 | (if (< (length (gethash 'scratch info)) 2) | 570 | (if (< (length (gethash 'scratch info)) 2) |
| 575 | nil | 571 | nil |
| @@ -629,8 +625,7 @@ version.") | |||
| 629 | socks-nslookup-program host)) | 625 | socks-nslookup-program host)) |
| 630 | (res host)) | 626 | (res host)) |
| 631 | (set-process-query-on-exit-flag proc nil) | 627 | (set-process-query-on-exit-flag proc nil) |
| 632 | (save-excursion | 628 | (with-current-buffer (process-buffer proc) |
| 633 | (set-buffer (process-buffer proc)) | ||
| 634 | (while (progn | 629 | (while (progn |
| 635 | (accept-process-output proc) | 630 | (accept-process-output proc) |
| 636 | (memq (process-status proc) '(run open)))) | 631 | (memq (process-status proc) '(run open)))) |