5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-23 07:35:39 +00:00

Set TCP socket options before upgrading connection

This commit is contained in:
Neil Alexander 2019-10-23 18:24:08 +01:00
parent 6a22e6c9de
commit cd77727c1e
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -355,6 +355,7 @@ func (t *tcp) call(saddr string, options interface{}, sintf string, upgrade *Tcp
func (t *tcp) handler(sock net.Conn, incoming bool, options interface{}, upgrade *TcpUpgrade) {
defer t.waitgroup.Done() // Happens after sock.close
defer sock.Close()
t.setExtraOptions(sock)
var upgraded bool
if upgrade != nil {
var err error
@ -365,7 +366,6 @@ func (t *tcp) handler(sock net.Conn, incoming bool, options interface{}, upgrade
upgraded = true
}
}
t.setExtraOptions(sock)
stream := stream{}
stream.init(sock)
var name, proto, local, remote string