From 47ff1eaf3bc13a702c8491d248d8d34d08796937 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 22 Sep 2015 00:55:15 +0300 Subject: [PATCH] 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) --- src/lib-http/http-client-request.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.47.3