]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: After peer has received 100 response, don't add ambiguity timeout anymore.
authorTimo Sirainen <tss@iki.fi>
Wed, 5 Jun 2013 13:40:01 +0000 (16:40 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 5 Jun 2013 13:40:01 +0000 (16:40 +0300)
The server should be sending the 100 responses then, and long delays
shouldn't be confused with them being missing.

src/lib-http/http-client-connection.c
src/lib-http/http-client-private.h

index b4c8b234381c4659d236c43c9a3efbdee1da870b..72824010ebd736bb996733aa9a144b5a73de0958 100644 (file)
@@ -295,7 +295,7 @@ bool http_client_connection_next_request(struct http_client_connection *conn)
           (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 @@ static void http_client_connection_input(struct connection *_conn)
                                        "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");
index 023f8e9a1bd2a270dd138e5aaa3f2079bbb2cbc3..396fc070f7592a895b3524c13fc70a02777bc921 100644 (file)
@@ -121,6 +121,7 @@ struct http_client_peer {
 
        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;
 };