Skip to content

Commit

Permalink
Increase proxy stall timeout (#263)
Browse files Browse the repository at this point in the history
Increase proxy stall timeout while ensuring that sessions transferring 0 bytes still timeout at 30s.
  • Loading branch information
mingyech authored Nov 14, 2023
1 parent 0029e20 commit 5383308
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/station/lib/proxies.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (
"github.com/refraction-networking/conjure/pkg/station/log"
)

const proxyStallTimeout = 30 * time.Second
const proxyStallTimeout = 2 * time.Minute
const proxyInitTimeout = 30 * time.Second
const resetIfNotClosedAfter = 10 // seconds

var (
Expand Down Expand Up @@ -119,12 +120,12 @@ func halfPipe(src net.Conn, dst net.Conn,
}()

// Set deadlines in case either side disappears.
err := src.SetDeadline(time.Now().Add(proxyStallTimeout))
err := src.SetDeadline(time.Now().Add(proxyInitTimeout))
if err != nil {
logger.Errorln("error setting deadline for src conn: ", tag)
return
}
err = dst.SetDeadline(time.Now().Add(proxyStallTimeout))
err = dst.SetDeadline(time.Now().Add(proxyInitTimeout))
if err != nil {
logger.Errorln("error setting deadline for dst conn: ", tag)
return
Expand Down

0 comments on commit 5383308

Please sign in to comment.