diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-05 18:17:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-05 18:17:37 +0000 |
commit | 23fe13890f31317cc2ab86ef55264622ed72375f (patch) | |
tree | b07ba0c79131fcc4cb524f8870dc98b09226dbfb /src/conversation | |
parent | 7de0ce15a52e32e4258d8008f8bbab3c71599a0e (diff) | |
download | gnunet-23fe13890f31317cc2ab86ef55264622ed72375f.tar.gz gnunet-23fe13890f31317cc2ab86ef55264622ed72375f.zip |
-fix message type
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/conversation_api.c | 33 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation.c | 7 | ||||
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 10 |
3 files changed, 33 insertions, 17 deletions
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index 0ad85131c..671315f74 100644 --- a/src/conversation/conversation_api.c +++ b/src/conversation/conversation_api.c | |||
@@ -980,7 +980,14 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) | |||
980 | 0 }, | 980 | 0 }, |
981 | { NULL, 0, 0 } | 981 | { NULL, 0, 0 } |
982 | }; | 982 | }; |
983 | if (NULL != call->mq) | 983 | struct GNUNET_CRYPTO_EccPublicSignKey my_zone; |
984 | |||
985 | if (CS_ACTIVE == call->state) | ||
986 | { | ||
987 | call->speaker->disable_speaker (call->speaker->cls); | ||
988 | call->mic->disable_microphone (call->mic->cls); | ||
989 | } | ||
990 | if (NULL != call->mq) | ||
984 | { | 991 | { |
985 | GNUNET_MQ_destroy (call->mq); | 992 | GNUNET_MQ_destroy (call->mq); |
986 | call->mq = NULL; | 993 | call->mq = NULL; |
@@ -990,6 +997,7 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) | |||
990 | GNUNET_CLIENT_disconnect (call->client); | 997 | GNUNET_CLIENT_disconnect (call->client); |
991 | call->client = NULL; | 998 | call->client = NULL; |
992 | } | 999 | } |
1000 | call->state = CS_SHUTDOWN; | ||
993 | call->client = GNUNET_CLIENT_connect ("conversation", call->cfg); | 1001 | call->client = GNUNET_CLIENT_connect ("conversation", call->cfg); |
994 | if (NULL == call->client) | 1002 | if (NULL == call->client) |
995 | return; | 1003 | return; |
@@ -997,6 +1005,17 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) | |||
997 | handlers, | 1005 | handlers, |
998 | &call_error_handler, | 1006 | &call_error_handler, |
999 | call); | 1007 | call); |
1008 | call->state = CS_LOOKUP; | ||
1009 | GNUNET_IDENTITY_ego_get_public_key (call->caller_id, | ||
1010 | &my_zone); | ||
1011 | call->gns_lookup = GNUNET_GNS_lookup (call->gns, | ||
1012 | call->callee, | ||
1013 | &my_zone, | ||
1014 | GNUNET_NAMESTORE_TYPE_PHONE, | ||
1015 | GNUNET_NO, | ||
1016 | NULL /* FIXME: add shortening support */, | ||
1017 | &handle_gns_response, call); | ||
1018 | GNUNET_assert (NULL != call->gns_lookup); | ||
1000 | } | 1019 | } |
1001 | 1020 | ||
1002 | 1021 | ||
@@ -1024,10 +1043,7 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1024 | void *event_handler_cls) | 1043 | void *event_handler_cls) |
1025 | { | 1044 | { |
1026 | struct GNUNET_CONVERSATION_Call *call; | 1045 | struct GNUNET_CONVERSATION_Call *call; |
1027 | struct GNUNET_CRYPTO_EccPublicSignKey my_zone; | ||
1028 | 1046 | ||
1029 | GNUNET_IDENTITY_ego_get_public_key (caller_id, | ||
1030 | &my_zone); | ||
1031 | call = GNUNET_new (struct GNUNET_CONVERSATION_Call); | 1047 | call = GNUNET_new (struct GNUNET_CONVERSATION_Call); |
1032 | call->cfg = cfg; | 1048 | call->cfg = cfg; |
1033 | call->caller_id = caller_id; | 1049 | call->caller_id = caller_id; |
@@ -1045,13 +1061,6 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1045 | GNUNET_CONVERSATION_call_stop (call, NULL); | 1061 | GNUNET_CONVERSATION_call_stop (call, NULL); |
1046 | return NULL; | 1062 | return NULL; |
1047 | } | 1063 | } |
1048 | call->gns_lookup = GNUNET_GNS_lookup (call->gns, callee, | ||
1049 | &my_zone, | ||
1050 | GNUNET_NAMESTORE_TYPE_PHONE, | ||
1051 | GNUNET_NO, | ||
1052 | NULL /* FIXME: add shortening support */, | ||
1053 | &handle_gns_response, call); | ||
1054 | GNUNET_assert (NULL != call->gns_lookup); | ||
1055 | return call; | 1064 | return call; |
1056 | } | 1065 | } |
1057 | 1066 | ||
@@ -1105,7 +1114,7 @@ GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call, | |||
1105 | GNUNET_GNS_disconnect (call->gns); | 1114 | GNUNET_GNS_disconnect (call->gns); |
1106 | call->gns = NULL; | 1115 | call->gns = NULL; |
1107 | } | 1116 | } |
1108 | 1117 | GNUNET_free (call->callee); | |
1109 | GNUNET_free (call); | 1118 | GNUNET_free (call); |
1110 | } | 1119 | } |
1111 | 1120 | ||
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index ba971049f..90b98b36f 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -286,15 +286,16 @@ call_event_handler (void *cls, | |||
286 | case GNUNET_CONVERSATION_EC_READY: | 286 | case GNUNET_CONVERSATION_EC_READY: |
287 | GNUNET_break (CS_RINGING == state); | 287 | GNUNET_break (CS_RINGING == state); |
288 | FPRINTF (stdout, | 288 | FPRINTF (stdout, |
289 | _("Connection established: %s\n"), | 289 | _("Connection established to `%s': %s\n"), |
290 | peer_name, | ||
290 | va_arg (va, const char *)); | 291 | va_arg (va, const char *)); |
291 | state = CS_CONNECTED; | 292 | state = CS_CONNECTED; |
292 | break; | 293 | break; |
293 | case GNUNET_CONVERSATION_EC_GNS_FAIL: | 294 | case GNUNET_CONVERSATION_EC_GNS_FAIL: |
294 | GNUNET_break (CS_RESOLVING == state); | 295 | GNUNET_break (CS_RESOLVING == state); |
295 | FPRINTF (stdout, | 296 | FPRINTF (stdout, |
296 | "%s", | 297 | _("Failed to resolve `%s'\n"), |
297 | _("Failed to resolve name\n")); | 298 | ego_name); |
298 | GNUNET_CONVERSATION_call_stop (call, NULL); | 299 | GNUNET_CONVERSATION_call_stop (call, NULL); |
299 | call = NULL; | 300 | call = NULL; |
300 | start_phone (); | 301 | start_phone (); |
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index b2d8af2c3..1e6fb10d9 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -1010,8 +1010,8 @@ inbound_tunnel (void *cls, | |||
1010 | uint32_t port) | 1010 | uint32_t port) |
1011 | { | 1011 | { |
1012 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1012 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1013 | _("Received incoming tunnel on port %d\n"), | 1013 | _("Received incoming tunnel on port %u\n"), |
1014 | port); | 1014 | (unsigned int) port); |
1015 | return NULL; | 1015 | return NULL; |
1016 | } | 1016 | } |
1017 | 1017 | ||
@@ -1040,6 +1040,10 @@ inbound_end (void *cls, | |||
1040 | line->tunnel_unreliable = NULL; | 1040 | line->tunnel_unreliable = NULL; |
1041 | return; | 1041 | return; |
1042 | } | 1042 | } |
1043 | GNUNET_assert (line->tunnel_reliable == tunnel); | ||
1044 | line->tunnel_reliable = NULL; | ||
1045 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1046 | "Mesh tunnel destroyed by mesh\n"); | ||
1043 | hup.header.size = sizeof (hup); | 1047 | hup.header.size = sizeof (hup); |
1044 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); | 1048 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); |
1045 | switch (line->status) | 1049 | switch (line->status) |
@@ -1095,6 +1099,8 @@ handle_client_disconnect (void *cls, | |||
1095 | { | 1099 | { |
1096 | struct Line *line; | 1100 | struct Line *line; |
1097 | 1101 | ||
1102 | if (NULL == client) | ||
1103 | return; | ||
1098 | line = GNUNET_SERVER_client_get_user_context (client, struct Line); | 1104 | line = GNUNET_SERVER_client_get_user_context (client, struct Line); |
1099 | if (NULL == line) | 1105 | if (NULL == line) |
1100 | return; | 1106 | return; |