changeset 19175:052d8d7654f6

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)
author Timo Sirainen <tss@iki.fi>
date Tue, 22 Sep 2015 00:55:15 +0300
parents fa306ce6c02a
children 0d3a438c8928
files src/lib-http/http-client-request.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-http/http-client-request.c	Tue Sep 22 00:40:14 2015 +0300
+++ b/src/lib-http/http-client-request.c	Tue Sep 22 00:55:15 2015 +0300
@@ -981,6 +981,8 @@
 		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 @@
 
 	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);
 }