mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-28 07:45:00 +00:00
(socks-send-command): Convert binary request to
unibyte before sending. This fixes mishandling of some port numbers such as 129.
This commit is contained in:
parent
6f06a17190
commit
6c6f788d8a
@ -1,3 +1,9 @@
|
||||
2009-11-27 Daiki Ueno <ueno@unixuser.org>
|
||||
|
||||
* net/socks.el (socks-send-command): Convert binary request to
|
||||
unibyte before sending. This fixes mishandling of some port
|
||||
numbers such as 129.
|
||||
|
||||
2009-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* help.el (describe-bindings-internal): Remove `interactive'.
|
||||
|
@ -435,27 +435,29 @@ version.")
|
||||
(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)
|
||||
|
Loading…
Reference in New Issue
Block a user