Permalink
Browse files

fix long-standing pending_connect/inactivity timeout issue

this reverts a change made for #374, which inadvertently disabled inactivity
timeouts altogether.

instead we always QueueHeartbeat when bConnectPending changes, so
GetNextHeartbeat can calculate a timeout based on the new connection
state. i confirmed this fixes the broken test on master, and the original
"20s delay" bug (using the repro in #393).

this should also address the timeout stacking issue reported in
igrigorik/em-http-request#149, as well as the original report in
igrigorik/em-http-request#222
  • Loading branch information...
1 parent c520f9d commit 27fdd5ba66639782e0b862cd322dc41b8643dc37 @tmm1 tmm1 committed Mar 8, 2013
Showing with 1 addition and 2 deletions.
  1. +1 −2 ext/ed.cpp
View
3 ext/ed.cpp
@@ -460,8 +460,7 @@ ConnectionDescriptor::SetConnectPending
void ConnectionDescriptor::SetConnectPending(bool f)
{
bConnectPending = f;
- if (f == false && NextHeartbeat)
- MyEventMachine->ClearHeartbeat(NextHeartbeat, this);
+ MyEventMachine->QueueHeartbeat(this);
_UpdateEvents();
}

0 comments on commit 27fdd5b

Please sign in to comment.