Bug fix: (correctly) revoke CurlResponderBuffer events.

This commit is contained in:
Aleric Inglewood
2012-10-21 17:26:57 +02:00
parent a4bf92dae4
commit f7626699da
3 changed files with 8 additions and 3 deletions

View File

@@ -1294,7 +1294,7 @@ CurlResponderBuffer::~CurlResponderBuffer()
{
ThreadSafeBufferedCurlEasyRequest* lockobj = get_lockobj();
AICurlEasyRequest_wat curl_easy_request_w(*lockobj); // Wait 'til possible callbacks have returned.
curl_easy_request_w->send_events_to(NULL);
send_events_to(NULL);
curl_easy_request_w->revokeCallbacks();
if (mResponder)
{

View File

@@ -223,8 +223,8 @@ class Responder : public AICurlResponderBufferEvents {
std::string const& getURL(void) const { return mURL; }
protected:
// Called when the "HTTP/1.0 <status> <reason>" header is received.
/*virual*/ void received_HTTP_header(void)
// Called when the "HTTP/1.x <status> <reason>" header is received.
/*virtual*/ void received_HTTP_header(void)
{
// It's possible that this page was moved (302), so we already saw headers
// from the 302 page and are starting over on the new page now.

View File

@@ -235,6 +235,11 @@ void AICurlEasyRequestStateMachine::finish_impl(void)
// Revoke callbacks.
{
AICurlEasyRequest_wat curl_easy_request_w(*mCurlEasyRequest);
if (mBuffered)
{
AICurlResponderBuffer_wat buffered_easy_request_w(*mCurlEasyRequest);
buffered_easy_request_w->send_events_to(NULL);
}
curl_easy_request_w->send_events_to(NULL);
curl_easy_request_w->revokeCallbacks();
}