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

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

commit c63035d732f95d14cdaac90def77fd47da5cca2d
Author: Ted Ross <tr...@apache.org>
AuthorDate: Thu Nov 12 16:56:02 2020 -0500

    DISPATCH-1654 - Removed the redundant copy of the ma_stream flag, leaving 
it in the message content only.
---
 src/message.c         | 10 +++++-----
 src/message_private.h |  3 +--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/message.c b/src/message.c
index 50a00fa..2d05fd0 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1102,7 +1102,6 @@ qd_message_t *qd_message_copy(qd_message_t *in_msg)
     qd_buffer_list_clone(&copy->ma_trace, &msg->ma_trace);
     qd_buffer_list_clone(&copy->ma_ingress, &msg->ma_ingress);
     copy->ma_phase = msg->ma_phase;
-    copy->ma_stream = msg->ma_stream;
     copy->strip_annotations_in  = msg->strip_annotations_in;
 
     copy->content = content;
@@ -1164,6 +1163,7 @@ void qd_message_message_annotations(qd_message_t *in_msg)
 
     if (ma_pf_stream) {
         content->ma_stream = qd_parse_as_int(ma_pf_stream);
+        qd_parse_free(ma_pf_stream);
     }
 
     return;
@@ -1201,7 +1201,7 @@ int qd_message_get_phase_annotation(const qd_message_t 
*in_msg)
 void qd_message_set_stream_annotation(qd_message_t *in_msg, bool stream)
 {
     qd_message_pvt_t *msg = (qd_message_pvt_t*) in_msg;
-    msg->ma_stream = stream;
+    msg->content->ma_stream = stream;
 }
 
 void qd_message_set_ingress_annotation(qd_message_t *in_msg, 
qd_composed_field_t *ingress_field)
@@ -1629,7 +1629,7 @@ static void 
compose_message_annotations_v1(qd_message_pvt_t *msg, qd_buffer_list
         !DEQ_IS_EMPTY(msg->ma_trace) ||
         !DEQ_IS_EMPTY(msg->ma_ingress) ||
         msg->ma_phase != 0 ||
-        msg->ma_stream) {
+        msg->content->ma_stream) {
 
         if (!map_started) {
             qd_compose_start_map(out_ma);
@@ -1660,9 +1660,9 @@ static void 
compose_message_annotations_v1(qd_message_pvt_t *msg, qd_buffer_list
             field_count++;
         }
 
-        if (msg->ma_stream) {
+        if (msg->content->ma_stream) {
             qd_compose_insert_symbol(field, QD_MA_STREAM);
-            qd_compose_insert_int(field, msg->ma_stream);
+            qd_compose_insert_int(field, msg->content->ma_stream);
             field_count++;
         }
         // pad out to N fields
diff --git a/src/message_private.h b/src/message_private.h
index 1d04ef7..85d37c1 100644
--- a/src/message_private.h
+++ b/src/message_private.h
@@ -122,7 +122,7 @@ typedef struct {
     qd_parsed_field_t   *ma_pf_to_override;
     qd_parsed_field_t   *ma_pf_trace;
     int                  ma_int_phase;
-    bool                 ma_stream;
+    bool                 ma_stream;                      // indicates whether 
this message is streaming
     uint64_t             max_message_size;               // configured max; 0 
if no max to enforce
     uint64_t             bytes_received;                 // bytes returned by 
pn_link_recv() when enforcing max_message_size
     uint32_t             fanout;                         // The number of 
receivers for this message, including in-process subscribers.
@@ -150,7 +150,6 @@ struct qd_message_pvt_t {
     qd_buffer_list_t               ma_trace;        // trace list in outgoing 
message annotations
     qd_buffer_list_t               ma_ingress;      // ingress field in 
outgoing message annotations
     int                            ma_phase;        // phase for the override 
address
-    bool                           ma_stream;       // indicates whether this 
message is streaming
     qd_message_stream_data_list_t  stream_data_list;  // TODO - move this to 
the content for one-time parsing (TLR)
     qd_message_stream_data_t      *next_stream_data;
     unsigned char                 *body_cursor;


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

Reply via email to