Modified qd_message_send() to check if the delivery has not been already aborted when try to abort a delivery
@@ -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.
+ if (!pn_delivery_aborted(pn_link_current(pnl))) {
pn_delivery_abort(pn_link_current(pnl));
+ }
return;
}
@@ -1591,8 +1593,10 @@ void qd_message_send(qd_message_t *in_msg,
if (msg->content->aborted) {
if (pn_link_current(pnl)) {
msg->send_complete = true;
+ if (!pn_delivery_aborted(pn_link_current(pnl))) {
pn_delivery_abort(pn_link_current(pnl));
}
+ }
break;
}
@@ -1655,9 +1659,11 @@ void qd_message_send(qd_message_t *in_msg,
msg->cursor.cursor = 0;
if (msg->content->aborted) {
+ if (!pn_delivery_aborted(pn_link_current(pnl))) {
pn_delivery_abort(pn_link_current(pnl));
}
}
+ }
else {
//
// There is more of the message to come, update your cursor pointers
