From 5d8f669559fb4152d900a804f89f050963716fae Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Mon, 16 Dec 2013 15:36:11 +0000 Subject: [PATCH] - extend mesh audio messag to contain source line number. This is needed to find the correct client channel to link unreliable audio channel --- src/conversation/conversation.h | 7 ++++++- src/conversation/gnunet-service-conversation.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h index 91afbbce4..bc78400f1 100644 --- a/src/conversation/conversation.h +++ b/src/conversation/conversation.h @@ -352,7 +352,12 @@ struct MeshAudioMessage /** * Target line on the receiving end. */ - uint32_t remote_line; + uint32_t remote_line GNUNET_PACKED; + + /** + * The source line sending this data + */ + uint32_t source_line GNUNET_PACKED; /* followed by audio data */ diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 5d1aaf6e1..f44f6f128 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c @@ -753,6 +753,7 @@ transmit_line_audio (void *cls, mam->header.size = htons (sizeof (struct MeshAudioMessage) + ch->audio_size); mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO); mam->remote_line = htonl (ch->remote_line); + mam->source_line = htonl (ch->line->local_line); memcpy (&mam[1], ch->audio_data, ch->audio_size); GNUNET_free (ch->audio_data); ch->audio_data = NULL; @@ -1259,7 +1260,8 @@ handle_mesh_audio_message (void *cls, (0 == memcmp (&ch->target, &sender, sizeof (struct GNUNET_PeerIdentity))) && - (NULL == ch->channel_unreliable) ) + (NULL == ch->channel_unreliable) && + (ch->remote_line == ntohl (msg->source_line)) ) break; } break; -- 2.25.1