From: Timo Sirainen Date: Mon, 21 Sep 2015 21:55:15 +0000 (+0300) Subject: lib-http: Avoid crashes on failing http_client_request_send_payload() calls X-Git-Tag: 2.2.19.rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47ff1eaf3bc13a702c8491d248d8d34d08796937;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Avoid crashes on failing http_client_request_send_payload() calls 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) --- diff --git a/src/lib-http/http-client-request.c b/src/lib-http/http-client-request.c index 96fe434fa6..98a6c70ba1 100644 --- a/src/lib-http/http-client-request.c +++ b/src/lib-http/http-client-request.c @@ -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); }