Mercurial > emacs
diff lisp/net/socks.el @ 106284:894b96ba4f65
(socks-send-command): Convert binary request to
unibyte before sending. This fixes mishandling of some port
numbers such as 129.
author | Daiki Ueno <ueno@unixuser.org> |
---|---|
date | Fri, 27 Nov 2009 07:35:14 +0000 |
parents | f8ba8d6fd250 |
children | 1d1d5d9bd884 |
line wrap: on
line diff
--- a/lisp/net/socks.el Fri Nov 27 04:24:47 2009 +0000 +++ b/lisp/net/socks.el Fri Nov 27 07:35:14 2009 +0000 @@ -435,27 +435,29 @@ (error "Unsupported address type for HTTP: %d" atype))) port))) ((equal version 4) - (setq request (format - "%c%c%c%c%s%s%c" - version ; version - command ; command - (lsh port -8) ; port, high byte - (- port (lsh (lsh port -8) 8)) ; port, low byte - addr ; address - (user-full-name) ; username - 0 ; terminate username - ))) + (setq request (string-make-unibyte + (format + "%c%c%c%c%s%s%c" + version ; version + command ; command + (lsh port -8) ; port, high byte + (- port (lsh (lsh port -8) 8)) ; port, low byte + addr ; address + (user-full-name) ; username + 0 ; terminate username + )))) ((equal version 5) - (setq request (format - "%c%c%c%c%s%c%c" - version ; version - command ; command - 0 ; reserved - atype ; address type - addr ; address - (lsh port -8) ; port, high byte - (- port (lsh (lsh port -8) 8)) ; port, low byte - ))) + (setq request (string-make-unibyte + (format + "%c%c%c%c%s%c%c" + version ; version + command ; command + 0 ; reserved + atype ; address type + addr ; address + (lsh port -8) ; port, high byte + (- port (lsh (lsh port -8) 8)) ; port, low byte + )))) (t (error "Unknown protocol version: %d" version))) (process-send-string proc request)