Merge branch v2.11 into v3.0
This commit is contained in:
commit
a6b00608d2
1 changed files with 8 additions and 9 deletions
|
@ -100,6 +100,11 @@ func (r *Router) ServeTCP(conn tcp.WriteCloser) {
|
||||||
// If there is a handler matching the connection metadata,
|
// If there is a handler matching the connection metadata,
|
||||||
// we let it handle the connection.
|
// we let it handle the connection.
|
||||||
if handler != nil {
|
if handler != nil {
|
||||||
|
// Remove read/write deadline and delegate this to underlying TCP server.
|
||||||
|
if err := conn.SetDeadline(time.Time{}); err != nil {
|
||||||
|
log.Error().Err(err).Msg("Error while setting deadline")
|
||||||
|
}
|
||||||
|
|
||||||
handler.ServeTCP(conn)
|
handler.ServeTCP(conn)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -128,15 +133,9 @@ func (r *Router) ServeTCP(conn tcp.WriteCloser) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove read/write deadline and delegate this to underlying tcp server (for now only handled by HTTP Server)
|
// Remove read/write deadline and delegate this to underlying TCP server (for now only handled by HTTP Server)
|
||||||
err = conn.SetReadDeadline(time.Time{})
|
if err := conn.SetDeadline(time.Time{}); err != nil {
|
||||||
if err != nil {
|
log.Error().Err(err).Msg("Error while setting deadline")
|
||||||
log.Error().Err(err).Msg("Error while setting read deadline")
|
|
||||||
}
|
|
||||||
|
|
||||||
err = conn.SetWriteDeadline(time.Time{})
|
|
||||||
if err != nil {
|
|
||||||
log.Error().Err(err).Msg("Error while setting write deadline")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
connData, err := tcpmuxer.NewConnData(hello.serverName, conn, hello.protos)
|
connData, err := tcpmuxer.NewConnData(hello.serverName, conn, hello.protos)
|
||||||
|
|
Loading…
Reference in a new issue