Mercurial > dovecot > core-2.2
changeset 16453:bcf93c30a500
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.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 05 Jun 2013 16:40:01 +0300 |
parents | 49e7a1c206f1 |
children | 5593d6129712 |
files | src/lib-http/http-client-connection.c src/lib-http/http-client-private.h |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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");
--- 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; };