aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api2_communication.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport_api2_communication.c')
-rw-r--r--src/transport/transport_api2_communication.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/transport/transport_api2_communication.c b/src/transport/transport_api2_communication.c
index 079982ca5..3811f463f 100644
--- a/src/transport/transport_api2_communication.c
+++ b/src/transport/transport_api2_communication.c
@@ -106,6 +106,11 @@ struct AckPending
106 * More-or-less unique ID for the message. 106 * More-or-less unique ID for the message.
107 */ 107 */
108 uint64_t mid; 108 uint64_t mid;
109
110 /**
111 * Queue ID of the queue which will be used for the message.
112 */
113 uint32_t qid;
109}; 114};
110 115
111 116
@@ -639,7 +644,8 @@ static void
639send_ack (struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 644send_ack (struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
640 int status, 645 int status,
641 const struct GNUNET_PeerIdentity *receiver, 646 const struct GNUNET_PeerIdentity *receiver,
642 uint64_t mid) 647 uint64_t mid,
648 uint32_t qid)
643{ 649{
644 struct GNUNET_MQ_Envelope *env; 650 struct GNUNET_MQ_Envelope *env;
645 struct GNUNET_TRANSPORT_SendMessageToAck *ack; 651 struct GNUNET_TRANSPORT_SendMessageToAck *ack;
@@ -647,6 +653,7 @@ send_ack (struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
647 env = GNUNET_MQ_msg (ack, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK); 653 env = GNUNET_MQ_msg (ack, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK);
648 ack->status = htonl (status); 654 ack->status = htonl (status);
649 ack->mid = mid; 655 ack->mid = mid;
656 ack->qid = qid;
650 ack->receiver = *receiver; 657 ack->receiver = *receiver;
651 GNUNET_MQ_send (ch->mq, env); 658 GNUNET_MQ_send (ch->mq, env);
652} 659}
@@ -665,7 +672,7 @@ send_ack_cb (void *cls)
665 struct GNUNET_TRANSPORT_CommunicatorHandle *ch = ap->ch; 672 struct GNUNET_TRANSPORT_CommunicatorHandle *ch = ap->ch;
666 673
667 GNUNET_CONTAINER_DLL_remove (ch->ap_head, ch->ap_tail, ap); 674 GNUNET_CONTAINER_DLL_remove (ch->ap_head, ch->ap_tail, ap);
668 send_ack (ch, GNUNET_OK, &ap->receiver, ap->mid); 675 send_ack (ch, GNUNET_OK, &ap->receiver, ap->mid, ap->qid);
669 GNUNET_free (ap); 676 GNUNET_free (ap);
670} 677}
671 678
@@ -696,13 +703,14 @@ handle_send_msg (void *cls, const struct GNUNET_TRANSPORT_SendMessageTo *smt)
696 /* queue is already gone, tell transport this one failed */ 703 /* queue is already gone, tell transport this one failed */
697 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 704 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
698 "Transmission failed, queue no longer exists.\n"); 705 "Transmission failed, queue no longer exists.\n");
699 send_ack (ch, GNUNET_NO, &smt->receiver, smt->mid); 706 send_ack (ch, GNUNET_NO, &smt->receiver, smt->mid, smt->qid);
700 return; 707 return;
701 } 708 }
702 ap = GNUNET_new (struct AckPending); 709 ap = GNUNET_new (struct AckPending);
703 ap->ch = ch; 710 ap->ch = ch;
704 ap->receiver = smt->receiver; 711 ap->receiver = smt->receiver;
705 ap->mid = smt->mid; 712 ap->mid = smt->mid;
713 ap->qid = smt->qid;
706 GNUNET_CONTAINER_DLL_insert (ch->ap_head, ch->ap_tail, ap); 714 GNUNET_CONTAINER_DLL_insert (ch->ap_head, ch->ap_tail, ap);
707 mh = (const struct GNUNET_MessageHeader *) &smt[1]; 715 mh = (const struct GNUNET_MessageHeader *) &smt[1];
708 env = GNUNET_MQ_msg_copy (mh); 716 env = GNUNET_MQ_msg_copy (mh);