commit 7e9066a29df86ede728d527fa3ebcdffca6f611a Author: Serene H git@keroserene.net Date: Tue Sep 20 08:52:45 2016 -0700
fix broker offer answer test --- broker/broker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/broker/broker.go b/broker/broker.go index 3561141..0ba29dc 100644 --- a/broker/broker.go +++ b/broker/broker.go @@ -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.
tor-commits@lists.torproject.org