Skip to content

Commit

Permalink
DISPATCH-1265 - Modified qd_message_send() to check if the delivery h…
Browse files Browse the repository at this point in the history
…as not been already aborted when try to abort a delivery
  • Loading branch information
ganeshmurthy committed Feb 11, 2019
1 parent 9b45cb9 commit 9670ce2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/message.c
Expand Up @@ -1484,7 +1484,9 @@ void qd_message_send(qd_message_t *in_msg,
// Declare the message to be sent,
msg->send_complete = true;
// the link has an outgoing deliver. abort it.
pn_delivery_abort(pn_link_current(pnl));
if (!pn_delivery_aborted(pn_link_current(pnl))) {
pn_delivery_abort(pn_link_current(pnl));
}
return;
}

Expand Down Expand Up @@ -1591,7 +1593,9 @@ void qd_message_send(qd_message_t *in_msg,
if (msg->content->aborted) {
if (pn_link_current(pnl)) {
msg->send_complete = true;
pn_delivery_abort(pn_link_current(pnl));
if (!pn_delivery_aborted(pn_link_current(pnl))) {
pn_delivery_abort(pn_link_current(pnl));
}
}
break;
}
Expand Down Expand Up @@ -1655,7 +1659,9 @@ void qd_message_send(qd_message_t *in_msg,
msg->cursor.cursor = 0;

if (msg->content->aborted) {
pn_delivery_abort(pn_link_current(pnl));
if (!pn_delivery_aborted(pn_link_current(pnl))) {
pn_delivery_abort(pn_link_current(pnl));
}
}
}
else {
Expand Down

0 comments on commit 9670ce2

Please sign in to comment.