diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-05 19:25:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-05 19:25:51 +0000 |
commit | 1388aef05980aca3e4973863da73e08885f05054 (patch) | |
tree | d11a62d99ad895e7d218b7aacddc8dda476f2d4d /src | |
parent | 99f7bc8650e09914047613c9a211c1e2c986d9f0 (diff) | |
download | gnunet-1388aef05980aca3e4973863da73e08885f05054.tar.gz gnunet-1388aef05980aca3e4973863da73e08885f05054.zip |
-fix double-free, clarify API
Diffstat (limited to 'src')
-rw-r--r-- | src/conversation/gnunet-conversation.c | 3 | ||||
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 6 | ||||
-rw-r--r-- | src/include/gnunet_conversation_service.h | 14 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index 90b98b36f..ce8a50a62 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -296,7 +296,6 @@ call_event_handler (void *cls, | |||
296 | FPRINTF (stdout, | 296 | FPRINTF (stdout, |
297 | _("Failed to resolve `%s'\n"), | 297 | _("Failed to resolve `%s'\n"), |
298 | ego_name); | 298 | ego_name); |
299 | GNUNET_CONVERSATION_call_stop (call, NULL); | ||
300 | call = NULL; | 299 | call = NULL; |
301 | start_phone (); | 300 | start_phone (); |
302 | break; | 301 | break; |
@@ -305,7 +304,6 @@ call_event_handler (void *cls, | |||
305 | FPRINTF (stdout, | 304 | FPRINTF (stdout, |
306 | "%s", | 305 | "%s", |
307 | _("Line busy\n")); | 306 | _("Line busy\n")); |
308 | GNUNET_CONVERSATION_call_stop (call, NULL); | ||
309 | call = NULL; | 307 | call = NULL; |
310 | start_phone (); | 308 | start_phone (); |
311 | break; | 309 | break; |
@@ -315,7 +313,6 @@ call_event_handler (void *cls, | |||
315 | FPRINTF (stdout, | 313 | FPRINTF (stdout, |
316 | _("Call terminated: %s\n"), | 314 | _("Call terminated: %s\n"), |
317 | va_arg (va, const char *)); | 315 | va_arg (va, const char *)); |
318 | GNUNET_CONVERSATION_call_stop (call, NULL); | ||
319 | call = NULL; | 316 | call = NULL; |
320 | start_phone (); | 317 | start_phone (); |
321 | break; | 318 | break; |
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 4b06ef3e8..4e2b1455d 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -295,7 +295,7 @@ handle_client_pickup_message (void *cls, | |||
295 | } | 295 | } |
296 | line->status = LS_CALLEE_CONNECTED; | 296 | line->status = LS_CALLEE_CONNECTED; |
297 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 297 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
298 | "Sending PICK_UP message to client with meta data `%s'\n", | 298 | "Sending PICK_UP message to mesh with meta data `%s'\n", |
299 | meta); | 299 | meta); |
300 | e = GNUNET_MQ_msg_extra (mppm, | 300 | e = GNUNET_MQ_msg_extra (mppm, |
301 | len, | 301 | len, |
@@ -880,7 +880,7 @@ handle_mesh_pickup_message (void *cls, | |||
880 | pick->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP); | 880 | pick->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP); |
881 | memcpy (&pick[1], metadata, len); | 881 | memcpy (&pick[1], metadata, len); |
882 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 882 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
883 | "Sending PICK UP message via mesh with metadata `%s'\n", | 883 | "Sending PICKED UP message to client with metadata `%s'\n", |
884 | metadata); | 884 | metadata); |
885 | GNUNET_SERVER_notification_context_unicast (nc, | 885 | GNUNET_SERVER_notification_context_unicast (nc, |
886 | line->client, | 886 | line->client, |
@@ -895,7 +895,7 @@ handle_mesh_pickup_message (void *cls, | |||
895 | if (NULL == line->tunnel_unreliable) | 895 | if (NULL == line->tunnel_unreliable) |
896 | { | 896 | { |
897 | GNUNET_break (0); | 897 | GNUNET_break (0); |
898 | } | 898 | } |
899 | return GNUNET_OK; | 899 | return GNUNET_OK; |
900 | } | 900 | } |
901 | 901 | ||
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h index 848643f95..cb84fcc67 100644 --- a/src/include/gnunet_conversation_service.h +++ b/src/include/gnunet_conversation_service.h | |||
@@ -127,18 +127,24 @@ enum GNUNET_CONVERSATION_EventCode | |||
127 | GNUNET_CONVERSATION_EC_READY, | 127 | GNUNET_CONVERSATION_EC_READY, |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * We failed to locate a phone record in GNS. | 130 | * We failed to locate a phone record in GNS. After this invocation, |
131 | * the respective call handle will be automatically destroyed and the | ||
132 | * client must no longer call #GNUNET_CONVERSATION_call_stop. | ||
131 | */ | 133 | */ |
132 | GNUNET_CONVERSATION_EC_GNS_FAIL, | 134 | GNUNET_CONVERSATION_EC_GNS_FAIL, |
133 | 135 | ||
134 | /** | 136 | /** |
135 | * The phone is busy. Varargs will be empty. | 137 | * The phone is busy. Varargs will be empty. After this invocation, |
138 | * the respective call handle will be automatically destroyed and the | ||
139 | * client must no longer call #GNUNET_CONVERSATION_call_stop. | ||
136 | */ | 140 | */ |
137 | GNUNET_CONVERSATION_EC_BUSY, | 141 | GNUNET_CONVERSATION_EC_BUSY, |
138 | 142 | ||
139 | /** | 143 | /** |
140 | * The conversation was terminated, a reason may be supplied | 144 | * The conversation was terminated, a reason may be supplied as a |
141 | * as a `const char *` in the varargs. | 145 | * `const char *` in the varargs. After this invocation, the |
146 | * respective call handle will be automatically destroyed and the | ||
147 | * client must no longer call #GNUNET_CONVERSATION_call_stop. | ||
142 | */ | 148 | */ |
143 | GNUNET_CONVERSATION_EC_TERMINATED | 149 | GNUNET_CONVERSATION_EC_TERMINATED |
144 | 150 | ||