dovecot-2.2: lib-http: After peer has received 100 response, don...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 5 16:40:14 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/bcf93c30a500
changeset: 16453:bcf93c30a500
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 05 16:40:01 2013 +0300
description:
lib-http: After peer has received 100 response, don't add ambiguity timeout anymore.
The server should be sending the 100 responses then, and long delays
shouldn't be confused with them being missing.

diffstat:

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

diffs (32 lines):

diff -r 49e7a1c206f1 -r bcf93c30a500 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c	Wed Jun 05 16:28:16 2013 +0300
+++ b/src/lib-http/http-client-connection.c	Wed Jun 05 16:40:01 2013 +0300
@@ -295,7 +295,7 @@
 	   (Continue) status code, the client SHOULD NOT wait for an indefinite
 	   period before sending the payload body.
 	 */
-	if (req->payload_sync) {
+	if (req->payload_sync && !conn->peer->seen_100_response) {
 		i_assert(req->payload_chunked || req->payload_size > 0);
 		i_assert(conn->to_response == NULL);
 		conn->to_response =	timeout_add(HTTP_CLIENT_CONTINUE_TIMEOUT_MSECS,
@@ -529,6 +529,8 @@
 					"Got 100-continue response after timeout");
 				return;
 			}
+			conn->peer->no_payload_sync = FALSE;
+			conn->peer->seen_100_response = TRUE;
 			conn->payload_continue = TRUE;
 			http_client_connection_debug(conn,
 				"Got expected 100-continue response");
diff -r 49e7a1c206f1 -r bcf93c30a500 src/lib-http/http-client-private.h
--- a/src/lib-http/http-client-private.h	Wed Jun 05 16:28:16 2013 +0300
+++ b/src/lib-http/http-client-private.h	Wed Jun 05 16:40:01 2013 +0300
@@ -121,6 +121,7 @@
 
 	unsigned int destroyed:1;        /* peer is being destroyed */
 	unsigned int no_payload_sync:1;  /* expect: 100-continue failed before */
+	unsigned int seen_100_response:1;/* expect: 100-continue succeeded before */
 	unsigned int last_connect_failed:1;
 };
 


More information about the dovecot-cvs mailing list