mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Set initial timeout on UDP proxy connection creation
This commit is contained in:
parent
6aabd9804f
commit
d1c93384e9
@ -226,6 +226,10 @@ func (udp *udpProxySocket) getBackendConn(activeClients *clientCache, cliAddr ne
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if err = svrConn.SetDeadline(time.Now().Add(timeout)); err != nil {
|
||||||
|
glog.Errorf("SetDeadline failed: %v", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
activeClients.clients[cliAddr.String()] = svrConn
|
activeClients.clients[cliAddr.String()] = svrConn
|
||||||
go func(cliAddr net.Addr, svrConn net.Conn, activeClients *clientCache, timeout time.Duration) {
|
go func(cliAddr net.Addr, svrConn net.Conn, activeClients *clientCache, timeout time.Duration) {
|
||||||
defer util.HandleCrash()
|
defer util.HandleCrash()
|
||||||
|
Loading…
Reference in New Issue
Block a user