- add underlay api implementation
[oweals/gnunet.git] / src / conversation / gnunet-service-conversation.c
index 6e79ad3dddbdaf53709a4002fc7a30503109b8b9..df8d4e9f24cf9bfdde73202854738f136e7edef3 100644 (file)
@@ -701,8 +701,7 @@ handle_client_call_message (void *cls,
                                                      ch,
                                                      &msg->target,
                                                      GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL,
-                                                     GNUNET_NO,
-                                                     GNUNET_YES);
+                                                     GNUNET_MESH_OPTION_RELIABLE);
   ch->reliable_mq = GNUNET_MESH_mq_create (ch->channel_reliable);
   e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING);
   ring->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING);
@@ -757,8 +756,8 @@ transmit_line_audio (void *cls,
   GNUNET_free (ch->audio_data);
   ch->audio_data = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Sending %u bytes of audio data via mesh\n",
-              ch->audio_size);
+              "Sending %u bytes of audio data on line %u via mesh\n",
+              ch->audio_size, ch->remote_line);
   return sizeof (struct MeshAudioMessage) + ch->audio_size;
 }
 
@@ -935,6 +934,7 @@ handle_mesh_ring_message (void *cls,
   ch->channel_reliable = channel;
   ch->reliable_mq = GNUNET_MESH_mq_create (ch->channel_reliable);
   ch->cid = line->cid_gen++;
+  ch->target = msg->source;
   *channel_ctx = ch;
   cring.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING);
   cring.header.size = htons (sizeof (cring));
@@ -1072,8 +1072,7 @@ handle_mesh_pickup_message (void *cls,
                                                        ch,
                                                        &ch->target,
                                                        GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO,
-                                                       GNUNET_YES,
-                                                       GNUNET_NO);
+                                                       GNUNET_MESH_OPTION_DEFAULT);
   if (NULL == ch->channel_unreliable)
   {
     GNUNET_break (0);
@@ -1239,7 +1238,7 @@ handle_mesh_audio_message (void *cls,
       GNUNET_break (0);
       return GNUNET_OK;
     }
-    sender = *(info->peer);
+    sender = info->peer;
     for (line = lines_head; NULL != line; line = line->next)
       if (line->local_line == ntohl (msg->remote_line))
       {
@@ -1272,7 +1271,7 @@ handle_mesh_audio_message (void *cls,
   cam->cid = ch->cid;
   memcpy (&cam[1], &msg[1], msize);
   GNUNET_SERVER_notification_context_unicast (nc,
-                                              line->client,
+                                              ch->line->client,
                                               &cam->header,
                                               GNUNET_YES);
   GNUNET_MESH_receive_done (channel);
@@ -1288,6 +1287,7 @@ handle_mesh_audio_message (void *cls,
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port port
+ * @param options channel option flags
  * @return initial channel context for the channel;
  *         (can be NULL -- that's not an error)
  */
@@ -1295,7 +1295,7 @@ static void *
 inbound_channel (void *cls,
                 struct GNUNET_MESH_Channel *channel,
                const struct GNUNET_PeerIdentity *initiator,
-                uint32_t port)
+                uint32_t port, enum GNUNET_MESH_ChannelOption options)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
              _("Received incoming channel on port %u\n"),