ganeshmurthy commented on a change in pull request #692: DISPATCH-975: 
Implement max-message-size policy restrictions
URL: https://github.com/apache/qpid-dispatch/pull/692#discussion_r383494348
 
 

 ##########
 File path: src/message.c
 ##########
 @@ -1409,10 +1413,23 @@ qd_message_t *qd_message_receive(pn_delivery_t 
*delivery)
             recv_error = true;
         } else if (rc > 0) {
             //
-            // We have received a positive number of bytes for the message.  
Advance
-            // the cursor in the buffer.
+            // We have received a positive number of bytes for the message.  
+            // Advance the cursor in the buffer.
             //
             qd_buffer_insert(content->pending, rc);
+
+            // Handle maxMessageSize violations
+            if (content->max_message_size) {
+                content->bytes_received += rc;
+                if (content->bytes_received > content->max_message_size)
+                {
+                    content->oversize_detected = true;
+                    content->oversize = true;
 
 Review comment:
   Can we do away with the content->oversize, just use the 
content->oversize_detected instead ?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to