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

[qpid-dispatch] branch dev-protocol-adaptors updated: DISPATCH-1742: Added new function qd_message_body_data_payload_length()

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

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


The following commit(s) were added to refs/heads/dev-protocol-adaptors by this push:
     new 47090e3  DISPATCH-1742: Added new function qd_message_body_data_payload_length()
47090e3 is described below

commit 47090e32a15ec1bc0174e87359c84528286b5242
Author: Ganesh Murthy <gm...@apache.org>
AuthorDate: Fri Sep 11 13:51:43 2020 -0400

    DISPATCH-1742: Added new function qd_message_body_data_payload_length()
---
 include/qpid/dispatch/message.h | 11 +++++++++++
 src/message.c                   | 10 ++++++++++
 2 files changed, 21 insertions(+)

diff --git a/include/qpid/dispatch/message.h b/include/qpid/dispatch/message.h
index d3dadb6..f1f2295 100644
--- a/include/qpid/dispatch/message.h
+++ b/include/qpid/dispatch/message.h
@@ -330,6 +330,17 @@ int qd_message_body_data_buffer_count(const qd_message_body_data_t *body_data);
  */
 int qd_message_body_data_buffers(qd_message_body_data_t *body_data, pn_raw_buffer_t *buffers, int offset, int count);
 
+/**
+ * qd_message_body_data_payload_length
+ *
+ * Given a body_data object, return the length of the payload.
+ * This will equal the sum of the length of all qd_buffer_t objects contained in payload portion of the body_data object
+ *
+ * @param body_data Pointer to a body_data object produced by qd_message_next_body_data
+ * @return The length of the payload of the passed in body data object.
+ */
+size_t qd_message_body_data_payload_length(const qd_message_body_data_t *body_data);
+
 
 /**
  * qd_message_body_data_release
diff --git a/src/message.c b/src/message.c
index 8c2cf57..0b727b9 100644
--- a/src/message.c
+++ b/src/message.c
@@ -2368,6 +2368,16 @@ qd_iterator_t *qd_message_body_data_iterator(const qd_message_body_data_t *body_
     return qd_iterator_buffer(location->buffer, location->offset, location->length, ITER_VIEW_ALL);
 }
 
+/**
+ * qd_message_body_data_payload_length
+ *
+ * Given a body_data object, return the length of the payload.
+ */
+size_t qd_message_body_data_payload_length(const qd_message_body_data_t *body_data)
+{
+    return body_data->payload.length;
+}
+
 
 /**
  * qd_message_body_data_buffer_count


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