You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2020/08/11 16:17:29 UTC

[qpid-dispatch] branch dev-protocol-adaptors updated (c20b29a -> 713fdfe)

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

tross pushed a change to branch dev-protocol-adaptors
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.


    from c20b29a  DISPATCH-1744: refactor common HTTP code
     new 8be9471  DISPATCH-1742 - Removed compiler warning by initializing a boolean value.
     new 713fdfe  DISPATCH-1742 - Handle zero-length body sections.  Fixed a bug in body content length calculation.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/adaptors/http1/http1_lib.c |  2 +-
 src/message.c                  | 13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 01/02: DISPATCH-1742 - Removed compiler warning by initializing a boolean value.

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tross pushed a commit to branch dev-protocol-adaptors
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 8be9471524c37fe40c6e25a6574a1ca568d26e0b
Author: Ted Ross <tr...@apache.org>
AuthorDate: Tue Aug 11 12:15:17 2020 -0400

    DISPATCH-1742 - Removed compiler warning by initializing a boolean value.
---
 src/adaptors/http1/http1_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/adaptors/http1/http1_lib.c b/src/adaptors/http1/http1_lib.c
index 991d492..102a1aa 100644
--- a/src/adaptors/http1/http1_lib.c
+++ b/src/adaptors/http1/http1_lib.c
@@ -1034,7 +1034,7 @@ static bool parse_body_chunked_trailer(http1_conn_t *conn, struct decoder_t *dec
 // Return True if there is more data pending to parse
 static bool parse_body_chunked(http1_conn_t *conn, struct decoder_t *decoder)
 {
-    bool more;
+    bool more = true;
     switch (decoder->chunk_state) {
 
     case HTTP1_CHUNK_HEADER:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 02/02: DISPATCH-1742 - Handle zero-length body sections. Fixed a bug in body content length calculation.

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tross pushed a commit to branch dev-protocol-adaptors
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 713fdfef047c3a94cb69ab7d357ff99948d57589
Author: Ted Ross <tr...@apache.org>
AuthorDate: Tue Aug 11 12:16:08 2020 -0400

    DISPATCH-1742 - Handle zero-length body sections.  Fixed a bug in body content length calculation.
---
 src/message.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/message.c b/src/message.c
index 69312f3..4c5cd9c 100644
--- a/src/message.c
+++ b/src/message.c
@@ -2331,17 +2331,21 @@ void trim_body_data_headers(qd_message_body_data_t *body_data)
     assert(good);
     if (good) {
         unsigned char tag = 0;
+        size_t        vbin_hdr_len = 1;
         next_octet(&cursor, &buffer, &tag);
-        if (tag == QD_AMQP_VBIN8)
+        if (tag == QD_AMQP_VBIN8) {
             advance(&cursor, &buffer, 1);
-        else if (tag == QD_AMQP_VBIN32)
+            vbin_hdr_len += 1;
+        } else if (tag == QD_AMQP_VBIN32) {
             advance(&cursor, &buffer, 4);
+            vbin_hdr_len += 4;
+        }
 
         can_advance(&cursor, &buffer); // bump cursor to the next buffer if necessary
 
         body_data->payload.buffer     = buffer;
         body_data->payload.offset     = cursor - qd_buffer_base(buffer);
-        body_data->payload.length     = location->length;
+        body_data->payload.length     = location->length - vbin_hdr_len;
         body_data->payload.hdr_length = 0;
         body_data->payload.parsed     = true;
         body_data->payload.tag        = tag;
@@ -2372,6 +2376,9 @@ qd_iterator_t *qd_message_body_data_iterator(const qd_message_body_data_t *body_
  */
 int qd_message_body_data_buffer_count(const qd_message_body_data_t *body_data)
 {
+    if (body_data->payload.length == 0)
+        return 0;
+
     int count = 1;
     qd_buffer_t *buffer = body_data->payload.buffer;
     while (!!buffer && buffer != body_data->last_buffer) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org