- extend mesh audio messag to contain source line number. This is needed to find...
authorSree Harsha Totakura <totakura@in.tum.de>
Mon, 16 Dec 2013 15:36:11 +0000 (15:36 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Mon, 16 Dec 2013 15:36:11 +0000 (15:36 +0000)
src/conversation/conversation.h
src/conversation/gnunet-service-conversation.c

index 91afbbce4e0808c49e3178a4cfd830a7820bf067..bc78400f1e83a323cd13d4ae91dd2dc0ac4f4851 100644 (file)
@@ -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 */
 
index 5d1aaf6e17007f232a73749652002b8f01eea16e..f44f6f128f470c7461480d688b2ddefe30cd96cd 100644 (file)
@@ -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;