lib/connections: Handle wrapped connection in SetTCPOptions (fixes #3223)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3225
This commit is contained in:
committed by
Audrius Butkevicius
parent
9d756525ce
commit
ac40b27c79
@@ -8,7 +8,6 @@ package connections
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
@@ -40,7 +39,7 @@ func (d *relayDialer) Dial(id protocol.DeviceID, uri *url.URL) (IntermediateConn
|
||||
return IntermediateConnection{}, err
|
||||
}
|
||||
|
||||
err = dialer.SetTCPOptions(conn.(*net.TCPConn))
|
||||
err = dialer.SetTCPOptions(conn)
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
return IntermediateConnection{}, err
|
||||
|
||||
@@ -8,7 +8,6 @@ package connections
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"net/url"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -74,7 +73,7 @@ func (t *relayListener) Serve() {
|
||||
continue
|
||||
}
|
||||
|
||||
err = dialer.SetTCPOptions(conn.(*net.TCPConn))
|
||||
err = dialer.SetTCPOptions(conn)
|
||||
if err != nil {
|
||||
l.Infoln(err)
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ func (t *tcpListener) Serve() {
|
||||
|
||||
l.Debugln("connect from", conn.RemoteAddr())
|
||||
|
||||
err = dialer.SetTCPOptions(conn.(*net.TCPConn))
|
||||
err = dialer.SetTCPOptions(conn)
|
||||
if err != nil {
|
||||
l.Infoln(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user