]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Optimized http_client_request_send_payload() fix
authorTimo Sirainen <tss@iki.fi>
Mon, 21 Sep 2015 22:05:09 +0000 (01:05 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 21 Sep 2015 22:05:09 +0000 (01:05 +0300)
Badly copy&pasted my original fix, instead of noticing that Stephan's fix
was slightly different. Probably shouldn't have made actual difference
other than for performance.

src/lib-http/http-client-request.c

index 98a6c70ba114b9836610ad44f0be6833b9ceef48..8345d79c2d33cd6be54f070b6ece687292c19df2 100644 (file)
@@ -981,7 +981,7 @@ http_client_request_send_error(struct http_client_request *req,
                if (!sending && req->payload_input != NULL)
                        i_stream_unref(&req->payload_input);
        }
-       if (req->client->ioloop != NULL)
+       if (req->payload_wait && req->client->ioloop != NULL)
                io_loop_stop(req->client->ioloop);
 }
 
@@ -1041,7 +1041,7 @@ void http_client_request_abort(struct http_client_request **_req)
 
        if (req->queue != NULL)
                http_client_queue_drop_request(req->queue, req);
-       if (req->client->ioloop != NULL)
+       if (req->payload_wait && req->client->ioloop != NULL)
                io_loop_stop(req->client->ioloop);
        http_client_request_unref(_req);
 }