[tor-commits] [meek/bug13171] Use 1, not 0, as the dummy port number.
dcf at torproject.org
dcf at torproject.org
Mon Dec 14 11:10:47 UTC 2015
commit 758d7b7b45e96e00d46225fa26933bf15e76111a
Author: David Fifield <david at bamsoftware.com>
Date: Mon Dec 14 03:09:41 2015 -0800
Use 1, not 0, as the dummy port number.
0 causes this error:
[info] addr_port_lookup(): Port "0" out of range
(Even though simply omitting the port number causes it to be assigned 0
internally.)
---
meek-server/meek-server.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meek-server/meek-server.go b/meek-server/meek-server.go
index a111bc6..482fa3c 100644
--- a/meek-server/meek-server.go
+++ b/meek-server/meek-server.go
@@ -125,13 +125,13 @@ func (state *State) Get(w http.ResponseWriter, req *http.Request) {
// Get a string representing the original client address, if available, as a
// "host:port" string suitable to pass as the addr parameter to pt.DialOr. Never
// fails: if the original client address is not available, returns "". If the
-// original client address is available, the returned port number is always 0.
+// original client address is available, the returned port number is always 1.
func getUseraddr(req *http.Request) string {
ip, err := originalClientIP(req)
if err != nil {
return ""
}
- return net.JoinHostPort(ip.String(), "0")
+ return net.JoinHostPort(ip.String(), "1")
}
// Look up a session by id, or create a new one (with its OR port connection) if
More information about the tor-commits
mailing list