mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Don't log "SOCKS accepted" if there was an Accept error.
This actually caused a nil pointer dereference panic when Accept returned an error, because conn was nil.
This commit is contained in:
parent
1114acbcb4
commit
6a9c2bf951
1 changed files with 1 additions and 1 deletions
|
@ -57,13 +57,13 @@ func socksAcceptLoop(ln *pt.SocksListener, snowflakes SnowflakeCollector) error
|
|||
for {
|
||||
log.Println("SOCKS listening...")
|
||||
conn, err := ln.AcceptSocks()
|
||||
log.Println("SOCKS accepted: ", conn.Req)
|
||||
if err != nil {
|
||||
if e, ok := err.(net.Error); ok && e.Temporary() {
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
log.Println("SOCKS accepted: ", conn.Req)
|
||||
err = handler(conn, snowflakes)
|
||||
if err != nil {
|
||||
log.Printf("handler error: %s", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue