This is an automated email from the ASF dual-hosted git repository.

kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit d0caeb6e0fdfa3091992b854227c7d2ce8fafb11
Author: Kenneth Giusti <[email protected]>
AuthorDate: Thu Dec 10 16:03:07 2020 -0500

    DISPATCH-1744: bugfix - do not finish response if status is 1xx
---
 src/adaptors/http1/http1_codec.c  | 7 +++++--
 src/adaptors/http1/http1_server.c | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/adaptors/http1/http1_codec.c b/src/adaptors/http1/http1_codec.c
index 6c03e7f..ffa8a9f 100644
--- a/src/adaptors/http1/http1_codec.c
+++ b/src/adaptors/http1/http1_codec.c
@@ -1344,10 +1344,13 @@ void 
h1_codec_connection_rx_closed(h1_codec_connection_t *conn)
         struct decoder_t *decoder = &conn->decoder;
         h1_codec_request_state_t *hrs = decoder->hrs;
         if (hrs) {
-            // consider the response valid if length is unspecified since in
+            // consider the response complete if length is unspecified since in
             // this case the server must close the connection to complete the
-            // message body
+            // message body.  However if the response message is a "continue"
+            // then the final response never arrived and the response is
+            // incomplete
             if (decoder->state == HTTP1_MSG_STATE_BODY
+                && !IS_INFO_RESPONSE(hrs->response_code)
                 && !decoder->is_chunked
                 && !decoder->hdr_content_length) {
 
diff --git a/src/adaptors/http1/http1_server.c 
b/src/adaptors/http1/http1_server.c
index 706c1e3..cffcb5c 100644
--- a/src/adaptors/http1/http1_server.c
+++ b/src/adaptors/http1/http1_server.c
@@ -636,7 +636,7 @@ static bool _process_requests(qdr_http1_connection_t *hconn)
             if ((!hreq->request_acked || !hreq->request_settled) &&
                 hconn->cfg.aggregation == QD_AGGREGATION_NONE) {
 
-                if (hreq->request_dispo == 0)
+                if (!hreq->request_dispo || hreq->request_dispo == PN_ACCEPTED)
                     hreq->request_dispo = (hreq->base.out_http1_octets > 0
                                            ? PN_MODIFIED : PN_RELEASED);
 
@@ -990,7 +990,6 @@ static void _server_rx_done_cb(h1_codec_request_state_t 
*hrs)
            "[C%"PRIu64"][L%"PRIu64"] HTTP response message msg-id=%"PRIu64" 
decoding complete.",
            hconn->conn_id, hconn->in_link_id, hreq->base.msg_id);
 
-    hreq->response_complete = true;
     rmsg->rx_complete = true;
 
     if (!qd_message_receive_complete(msg)) {
@@ -1004,6 +1003,10 @@ static void _server_rx_done_cb(h1_codec_request_state_t 
*hrs)
         // We've finished the delivery, and don't care about outcome/settlement
         _server_response_msg_free(hreq, rmsg);
     }
+
+    // only consider the response complete if terminal response code (!1xx)
+    if (h1_codec_request_state_response_code(hrs) / 100 != 1)
+        hreq->response_complete = true;
 }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to