diff options
author | Bart Polot <bart@net.in.tum.de> | 2016-07-20 17:13:26 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2016-07-20 17:13:26 +0000 |
commit | 90c70e8315c4a366996da379f839dc84d21d5f38 (patch) | |
tree | 0bfd73d2da8b8efb8de888c09ea4dd5bfc4cdb0f /src/conversation | |
parent | 3aab63d5c50db0eb784d3b65b2bd989d3458c960 (diff) | |
download | gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.tar.gz gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.zip |
- fix CADET-using services
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index dcef0f18b..b547d814c 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -720,7 +720,7 @@ handle_client_call_message (void *cls, | |||
720 | ch->channel_reliable = GNUNET_CADET_channel_create (cadet, | 720 | ch->channel_reliable = GNUNET_CADET_channel_create (cadet, |
721 | ch, | 721 | ch, |
722 | &msg->target, | 722 | &msg->target, |
723 | GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, | 723 | GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL), |
724 | GNUNET_CADET_OPTION_RELIABLE); | 724 | GNUNET_CADET_OPTION_RELIABLE); |
725 | ch->reliable_mq = GNUNET_CADET_mq_create (ch->channel_reliable); | 725 | ch->reliable_mq = GNUNET_CADET_mq_create (ch->channel_reliable); |
726 | e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING); | 726 | e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING); |
@@ -1102,7 +1102,7 @@ handle_cadet_pickup_message (void *cls, | |||
1102 | ch->channel_unreliable = GNUNET_CADET_channel_create (cadet, | 1102 | ch->channel_unreliable = GNUNET_CADET_channel_create (cadet, |
1103 | ch, | 1103 | ch, |
1104 | &ch->target, | 1104 | &ch->target, |
1105 | GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, | 1105 | GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO), |
1106 | GNUNET_CADET_OPTION_DEFAULT); | 1106 | GNUNET_CADET_OPTION_DEFAULT); |
1107 | if (NULL == ch->channel_unreliable) | 1107 | if (NULL == ch->channel_unreliable) |
1108 | { | 1108 | { |
@@ -1351,13 +1351,14 @@ handle_cadet_audio_message (void *cls, | |||
1351 | */ | 1351 | */ |
1352 | static void * | 1352 | static void * |
1353 | inbound_channel (void *cls, | 1353 | inbound_channel (void *cls, |
1354 | struct GNUNET_CADET_Channel *channel, | 1354 | struct GNUNET_CADET_Channel *channel, |
1355 | const struct GNUNET_PeerIdentity *initiator, | 1355 | const struct GNUNET_PeerIdentity *initiator, |
1356 | uint32_t port, enum GNUNET_CADET_ChannelOption options) | 1356 | const struct GNUNET_HashCode *port, |
1357 | enum GNUNET_CADET_ChannelOption options) | ||
1357 | { | 1358 | { |
1358 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1359 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1359 | _("Received incoming Cadet channel on port %u\n"), | 1360 | _("Received incoming Cadet channel on port %s\n"), |
1360 | (unsigned int) port); | 1361 | GNUNET_h2s (port)); |
1361 | return NULL; | 1362 | return NULL; |
1362 | } | 1363 | } |
1363 | 1364 | ||
@@ -1557,11 +1558,6 @@ run (void *cls, | |||
1557 | 0}, | 1558 | 0}, |
1558 | {NULL, 0, 0} | 1559 | {NULL, 0, 0} |
1559 | }; | 1560 | }; |
1560 | static uint32_t ports[] = { | ||
1561 | GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, | ||
1562 | GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, | ||
1563 | 0 | ||
1564 | }; | ||
1565 | 1561 | ||
1566 | cfg = c; | 1562 | cfg = c; |
1567 | GNUNET_assert (GNUNET_OK == | 1563 | GNUNET_assert (GNUNET_OK == |
@@ -1569,10 +1565,8 @@ run (void *cls, | |||
1569 | &my_identity)); | 1565 | &my_identity)); |
1570 | cadet = GNUNET_CADET_connect (cfg, | 1566 | cadet = GNUNET_CADET_connect (cfg, |
1571 | NULL, | 1567 | NULL, |
1572 | &inbound_channel, | ||
1573 | &inbound_end, | 1568 | &inbound_end, |
1574 | cadet_handlers, | 1569 | cadet_handlers); |
1575 | ports); | ||
1576 | 1570 | ||
1577 | if (NULL == cadet) | 1571 | if (NULL == cadet) |
1578 | { | 1572 | { |
@@ -1580,6 +1574,14 @@ run (void *cls, | |||
1580 | GNUNET_SCHEDULER_shutdown (); | 1574 | GNUNET_SCHEDULER_shutdown (); |
1581 | return; | 1575 | return; |
1582 | } | 1576 | } |
1577 | |||
1578 | GNUNET_CADET_open_port (cadet, | ||
1579 | GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL), | ||
1580 | &inbound_channel, NULL); | ||
1581 | GNUNET_CADET_open_port (cadet, | ||
1582 | GC_u2h (GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO), | ||
1583 | &inbound_channel, NULL); | ||
1584 | |||
1583 | nc = GNUNET_SERVER_notification_context_create (server, 16); | 1585 | nc = GNUNET_SERVER_notification_context_create (server, 16); |
1584 | GNUNET_SERVER_add_handlers (server, server_handlers); | 1586 | GNUNET_SERVER_add_handlers (server, server_handlers); |
1585 | GNUNET_SERVER_disconnect_notify (server, | 1587 | GNUNET_SERVER_disconnect_notify (server, |