You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2019/09/05 18:53:00 UTC

[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #557: Dispatch 1394 1404

kgiusti commented on a change in pull request #557: Dispatch 1394 1404
URL: https://github.com/apache/qpid-dispatch/pull/557#discussion_r321427312
 
 

 ##########
 File path: include/qpid/dispatch/message.h
 ##########
 @@ -232,8 +232,17 @@ void qd_message_send(qd_message_t *msg, qd_link_t *link, bool strip_outbound_ann
 /**
  * Check that the message is well-formed up to a certain depth.  Any part of the message that is
  * beyond the specified depth is not checked for validity.
+ *
+ * Note: some message sections are optional - QD_MESSAGE_OK is returned if the
+ * optional section is not present, as that is valid.
  */
-int qd_message_check(qd_message_t *msg, qd_message_depth_t depth);
+typedef enum {
+    QD_MESSAGE_INVALID,     // corrupt or malformed message
+    QD_MESSAGE_OK,          // valid up to depth, including 'depth' if not optional
+    QD_MESSAGE_INCOMPLETE   // have not received up to 'depth', or partial depth
+} qd_message_check_t;
 
 Review comment:
   Since the API is checking a message up to a given depth, why not use "depth" in the name?
   Something like:
   
   `typedef enum {`
   `QD_MESSAGE_DEPTH_INVALID, // corrupt or malformed message`
   `QD_MESSAGE_DEPTH_OK, // valid up to depth, including 'depth' if not optional`
   `QD_MESSAGE_DEPTH_INCOMPLETE // have not received up to 'depth', or partial depth`
   `} qd_message_depth_status_t;`
   ` `
   `qd_message_depth_status_t qd_message_check_depth(qd_message_t *msg, qd_message_depth_t depth);`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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