dovecot-2.2: lib-http: Remove request timeout from being used du...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 27 20:32:12 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/9fd54d123e22
changeset: 16571:9fd54d123e22
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 27 20:32:01 2013 +0300
description:
lib-http: Remove request timeout from being used during payload read.
The reading is done by the lib-http caller, which should have its own
timeouts.

diffstat:

 src/lib-http/http-client-connection.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r eb63569f0f73 -r 9fd54d123e22 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c	Thu Jun 27 20:28:51 2013 +0300
+++ b/src/lib-http/http-client-connection.c	Thu Jun 27 20:32:01 2013 +0300
@@ -269,8 +269,11 @@
 	if (conn->to_idle != NULL)
 		timeout_remove(&conn->to_idle);
 
-	if (conn->client->set.request_timeout_msecs > 0 &&
-	    conn->to_requests == NULL) {
+	if (conn->client->set.request_timeout_msecs == 0)
+		;
+	else if (conn->to_requests != NULL)
+		timeout_reset(conn->to_requests);
+	else {
 		conn->to_requests = timeout_add(conn->client->set.request_timeout_msecs,
 						http_client_connection_request_timeout, conn);
 	}
@@ -423,6 +426,10 @@
 		/* the callback may add its own I/O, so we need to remove
 		   our one before calling it */
 		io_remove(&conn->conn.io);
+		/* we've received the request itself, and we can't reset the
+		   timeout during the payload reading. */
+		if (conn->to_requests != NULL)
+			timeout_remove(&conn->to_requests);
 	}
 
 	http_client_connection_ref(conn);


More information about the dovecot-cvs mailing list