mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
fix broker offer answer test
This commit is contained in:
parent
47e1338290
commit
7e9066a29d
1 changed files with 2 additions and 1 deletions
|
@ -159,8 +159,9 @@ func clientOffers(ctx *BrokerContext, w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
// Otherwise, find the most available snowflake proxy, and pass the offer to it.
|
||||
// Delete must be deferred in order to correctly process answer request later.
|
||||
snowflake := heap.Pop(ctx.snowflakes).(*Snowflake)
|
||||
delete(ctx.idToSnowflake, snowflake.id)
|
||||
defer delete(ctx.idToSnowflake, snowflake.id)
|
||||
snowflake.offerChannel <- offer
|
||||
|
||||
// Wait for the answer to be returned on the channel or timeout.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue