commit 490bd4dab1b0fb81a30eb6ff47e9b6043b304ccb Author: David Fifield david@bamsoftware.com Date: Mon Dec 2 21:05:56 2019 -0700
Tweak formatting in scrubbedAddr. --- meek-server/meek-server.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/meek-server/meek-server.go b/meek-server/meek-server.go index af0084c..ea162fe 100644 --- a/meek-server/meek-server.go +++ b/meek-server/meek-server.go @@ -169,21 +169,17 @@ func (state *State) GetSession(sessionID string, req *http.Request) (*Session, e // scrubbedAddr is a phony net.Addr that returns "[scrubbed]" for all calls. type scrubbedAddr struct{}
-func (a scrubbedAddr) Network() string { - return "[scrubbed]" -} -func (a scrubbedAddr) String() string { - return "[scrubbed]" -} +func (a scrubbedAddr) Network() string { return "[scrubbed]" } +func (a scrubbedAddr) String() string { return "[scrubbed]" }
// Replace the Addr in a net.OpError with "[scrubbed]" for logging. func scrubError(err error) error { - if operr, ok := err.(*net.OpError); ok { + if err, ok := err.(*net.OpError); ok { // net.OpError contains Op, Net, Addr, and a subsidiary Err. The // (Op, Net, Addr) part is responsible for error text prefixes // like "read tcp X.X.X.X:YYYY:". We want that information but // don't want to log the literal address. - operr.Addr = scrubbedAddr{} + err.Addr = scrubbedAddr{} } return err }
tor-commits@lists.torproject.org