diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-12-16 15:36:11 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-12-16 15:36:11 +0000 |
commit | 5d8f669559fb4152d900a804f89f050963716fae (patch) | |
tree | ffee2942d68e3456e5c76a9ae7e30cd13cce16fe /src/conversation | |
parent | 5344248f0bbb85e427b1a32ac78b53aa41084d1d (diff) | |
download | gnunet-5d8f669559fb4152d900a804f89f050963716fae.tar.gz gnunet-5d8f669559fb4152d900a804f89f050963716fae.zip |
- extend mesh audio messag to contain source line number. This is needed to find the correct client channel to link unreliable audio channel
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/conversation.h | 7 | ||||
-rw-r--r-- | 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 | |||
352 | /** | 352 | /** |
353 | * Target line on the receiving end. | 353 | * Target line on the receiving end. |
354 | */ | 354 | */ |
355 | uint32_t remote_line; | 355 | uint32_t remote_line GNUNET_PACKED; |
356 | |||
357 | /** | ||
358 | * The source line sending this data | ||
359 | */ | ||
360 | uint32_t source_line GNUNET_PACKED; | ||
356 | 361 | ||
357 | /* followed by audio data */ | 362 | /* followed by audio data */ |
358 | 363 | ||
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, | |||
753 | mam->header.size = htons (sizeof (struct MeshAudioMessage) + ch->audio_size); | 753 | mam->header.size = htons (sizeof (struct MeshAudioMessage) + ch->audio_size); |
754 | mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO); | 754 | mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO); |
755 | mam->remote_line = htonl (ch->remote_line); | 755 | mam->remote_line = htonl (ch->remote_line); |
756 | mam->source_line = htonl (ch->line->local_line); | ||
756 | memcpy (&mam[1], ch->audio_data, ch->audio_size); | 757 | memcpy (&mam[1], ch->audio_data, ch->audio_size); |
757 | GNUNET_free (ch->audio_data); | 758 | GNUNET_free (ch->audio_data); |
758 | ch->audio_data = NULL; | 759 | ch->audio_data = NULL; |
@@ -1259,7 +1260,8 @@ handle_mesh_audio_message (void *cls, | |||
1259 | (0 == memcmp (&ch->target, | 1260 | (0 == memcmp (&ch->target, |
1260 | &sender, | 1261 | &sender, |
1261 | sizeof (struct GNUNET_PeerIdentity))) && | 1262 | sizeof (struct GNUNET_PeerIdentity))) && |
1262 | (NULL == ch->channel_unreliable) ) | 1263 | (NULL == ch->channel_unreliable) && |
1264 | (ch->remote_line == ntohl (msg->source_line)) ) | ||
1263 | break; | 1265 | break; |
1264 | } | 1266 | } |
1265 | break; | 1267 | break; |