Add an AITimer to AICurlEasyRequestStateMachine.

Fixes AIStateMachine to work thread-safe with the timer.
This commit is contained in:
Aleric Inglewood
2012-07-10 05:09:08 +02:00
parent f012f664d2
commit 0419f8bee9
7 changed files with 115 additions and 41 deletions

View File

@@ -831,11 +831,13 @@ void AICurlThread::run(void)
while (ready > 0 && iter.next(fd, ev_bitmask))
{
ready -= (ev_bitmask == (CURL_CSELECT_IN|CURL_CSELECT_OUT)) ? 2 : 1;
// This can cause libcurl to do callbacks and remove filedescriptors, causing us to reset their bits in the poll sets.
multi_handle_w->socket_action(fd, ev_bitmask);
llassert(ready >= 0);
}
// Should have handled them all.
llassert(ready == 0);
// Note that ready is not necessarily 0 here, because it's possible
// that libcurl removed file descriptors which we subsequently
// didn't handle.
}
multi_handle_w->check_run_count();
}