mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add context with timeout for client requests
Client timeouts are currently counted from when the client is matched with a proxy. Instead, count client timeouts from the moment when the request is received. Closes #40449
This commit is contained in:
parent
db0364ef87
commit
8343bbc336
6 changed files with 25 additions and 7 deletions
|
@ -217,7 +217,7 @@ func (i *IPC) ClientOffers(arg messages.Arg, response *[]byte) error {
|
|||
i.ctx.metrics.lock.Lock()
|
||||
i.ctx.metrics.clientRoundtripEstimate = time.Since(startTime) / time.Millisecond
|
||||
i.ctx.metrics.lock.Unlock()
|
||||
case <-time.After(time.Second * ClientTimeout):
|
||||
case <-arg.Context.Done():
|
||||
i.ctx.metrics.lock.Lock()
|
||||
i.ctx.metrics.UpdateRendezvousStats(arg.RemoteAddr, arg.RendezvousMethod, offer.natType, "timeout")
|
||||
i.ctx.metrics.lock.Unlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue