Remove erroneous logging around pt.*Error calls.

These functions are called for their side effect of sending a PT error
message on stdout; they also return a representation of the error
message as an error object for the caller to use if it wishes. These
functions *always* return a non-nil error object; it is not something to
be logged, any more than the return value of errors.New is.

The mistaken logging was added in
https://bugs.torproject.org/31794
b26c7a7a73
3ec9dd19fa
ed3d42e1ec
This commit is contained in:
David Fifield 2020-01-20 23:57:31 -07:00
parent 37aaaffa15
commit 5ff75e1034
3 changed files with 7 additions and 21 deletions

View file

@ -157,9 +157,7 @@ func main() {
log.Fatal(err)
}
if ptInfo.ProxyURL != nil {
if err := pt.ProxyError("proxy is not supported"); err != nil {
log.Printf("call to pt.ProxyError generated error: %v", err)
}
pt.ProxyError("proxy is not supported")
os.Exit(1)
}
listeners := make([]net.Listener, 0)
@ -169,18 +167,14 @@ func main() {
// TODO: Be able to recover when SOCKS dies.
ln, err := pt.ListenSocks("tcp", "127.0.0.1:0")
if err != nil {
if inerr := pt.CmethodError(methodName, err.Error()); inerr != nil {
log.Printf("handling error generated by pt.ListenSocks with pt.CmethodError generated error: %v", inerr)
}
pt.CmethodError(methodName, err.Error())
break
}
go socksAcceptLoop(ln, snowflakes)
pt.Cmethod(methodName, ln.Version(), ln.Addr())
listeners = append(listeners, ln)
default:
if err := pt.CmethodError(methodName, "no such method"); err != nil {
log.Printf("calling pt.CmethodError generated error: %v", err)
}
pt.CmethodError(methodName, "no such method")
}
}
pt.CmethodsDone()