dovecot-2.2: lib-http: client: Fixed double unref of request whe...

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 2 21:48:47 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/5205f3bd1a27
changeset: 18213:5205f3bd1a27
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon Feb 02 23:48:30 2015 +0200
description:
lib-http: client: Fixed double unref of request when error occurs during http_client_request_try_retry().
Much like when the request is first submitted, any errors that occur while attempting a retry from within the callback are now delayed in a zero timer.

diffstat:

 src/lib-http/http-client-request.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (19 lines):

diff -r 90e1829ba80e -r 5205f3bd1a27 src/lib-http/http-client-request.c
--- a/src/lib-http/http-client-request.c	Mon Feb 02 10:26:44 2015 +0200
+++ b/src/lib-http/http-client-request.c	Mon Feb 02 23:48:30 2015 +0200
@@ -912,10 +912,11 @@
 	if (req->queue != NULL)
 		http_client_queue_drop_request(req->queue, req);
 
-	if (!req->submitted) {
-		/* we're still in http_client_request_submit(). delay
-		   reporting the error, so the caller doesn't have to handle
-		   immediate callbacks. */
+	if (!req->submitted ||
+		req->state == HTTP_REQUEST_STATE_GOT_RESPONSE) {
+		/* we're still in http_client_request_submit() or in the callback
+		   during a retry attempt. delay reporting the error, so the caller
+		   doesn't have to handle immediate or nested callbacks. */
 		i_assert(req->delayed_error == NULL);
 		req->delayed_error = p_strdup(req->pool, error);
 		req->delayed_error_status = status;


More information about the dovecot-cvs mailing list