[
https://issues.apache.org/jira/browse/DISPATCH-975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17050569#comment-17050569
]
ASF GitHub Bot commented on DISPATCH-975:
-----------------------------------------
kgiusti commented on pull request #694: DISPATCH-975: Enforce max message size
on message ingress
URL: https://github.com/apache/qpid-dispatch/pull/694#discussion_r387298396
##########
File path: src/router_node.c
##########
@@ -329,12 +330,33 @@ static bool AMQP_rx_handler(void* context, qd_link_t
*link)
qdr_delivery_t *delivery = qdr_node_delivery_qdr_from_pn(pnd);
bool next_delivery = false;
- //
- // Receive the message into a local representation.
- //
qd_message_t *msg = qd_message_receive(pnd);
+
+ int oversize = qd_message_exceeded_max_message_size(msg);
+ if (oversize > 0) {
+ // message is bigger than maxMessageSize
+ if (oversize == 1) {
+ // went oversize on this pass
+ qdr_link_t *rlink = (qdr_link_t*) qd_link_get_context(link);
+ qd_log(qd_policy_log_source(), QD_LOG_WARNING,
"[C%"PRIu64"][L%"PRIu64"] DENY AMQP Transfer maxMessageSize exceeded. rhost:%s",
+ rlink->conn->identity, rlink->identity,
qd_connection_name(conn));
+ // increment policy counters
+ qd_policy_count_max_size_event(pn_link, conn);
+ // reject delivery that went oversize
+ pn_delivery_update(pnd, PN_REJECTED);
+ // Initiate link close with error.
+ pn_condition_t * cond = pn_link_condition(pn_link);
+ (void) pn_condition_set_name(cond,
QD_AMQP_COND_MESSAGE_SIZE_EXCEEDED);
+ pn_link_close(pn_link);
+ // Abort outbound deliveries that were receiving this incoming
delivery
+ qdr_node_disconnect_deliveries(router->router_core, link,
delivery, pnd);
Review comment:
If the message has not yet been forwarded to the core, then delivery here
will be null. qdr_node_disconnect_deliveries will crash in that case IIUC.
----------------------------------------------------------------
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]
> Policy has no provision for limiting user message size
> ------------------------------------------------------
>
> Key: DISPATCH-975
> URL: https://issues.apache.org/jira/browse/DISPATCH-975
> Project: Qpid Dispatch
> Issue Type: Bug
> Reporter: Charles E. Rolke
> Assignee: Charles E. Rolke
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]