]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Avoid crashes on failing http_client_request_send_payload() calls
authorTimo Sirainen <tss@iki.fi>
Mon, 21 Sep 2015 21:55:15 +0000 (00:55 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 21 Sep 2015 21:55:15 +0000 (00:55 +0300)
It HTTP server connection died, ioloop might not have anything to do
anymore:

Panic: file ioloop-epoll.c: line 187 (io_loop_handler_run_internal): assertion failed: (msecs >= 0)

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

index 96fe434fa68f7d1bf910ed9ef1c5bd07f1cc27f1..98a6c70ba114b9836610ad44f0be6833b9ceef48 100644 (file)
@@ -981,6 +981,8 @@ 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)
+               io_loop_stop(req->client->ioloop);
 }
 
 void http_client_request_error_delayed(struct http_client_request **_req)
@@ -1039,6 +1041,8 @@ 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)
+               io_loop_stop(req->client->ioloop);
        http_client_request_unref(_req);
 }