commit 1388aef05980aca3e4973863da73e08885f05054
parent 99f7bc8650e09914047613c9a211c1e2c986d9f0
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 5 Oct 2013 19:25:51 +0000
-fix double-free, clarify API
Diffstat:
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
@@ -296,7 +296,6 @@ call_event_handler (void *cls,
FPRINTF (stdout,
_("Failed to resolve `%s'\n"),
ego_name);
- GNUNET_CONVERSATION_call_stop (call, NULL);
call = NULL;
start_phone ();
break;
@@ -305,7 +304,6 @@ call_event_handler (void *cls,
FPRINTF (stdout,
"%s",
_("Line busy\n"));
- GNUNET_CONVERSATION_call_stop (call, NULL);
call = NULL;
start_phone ();
break;
@@ -315,7 +313,6 @@ call_event_handler (void *cls,
FPRINTF (stdout,
_("Call terminated: %s\n"),
va_arg (va, const char *));
- GNUNET_CONVERSATION_call_stop (call, NULL);
call = NULL;
start_phone ();
break;
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
@@ -295,7 +295,7 @@ handle_client_pickup_message (void *cls,
}
line->status = LS_CALLEE_CONNECTED;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending PICK_UP message to client with meta data `%s'\n",
+ "Sending PICK_UP message to mesh with meta data `%s'\n",
meta);
e = GNUNET_MQ_msg_extra (mppm,
len,
@@ -880,7 +880,7 @@ handle_mesh_pickup_message (void *cls,
pick->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP);
memcpy (&pick[1], metadata, len);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending PICK UP message via mesh with metadata `%s'\n",
+ "Sending PICKED UP message to client with metadata `%s'\n",
metadata);
GNUNET_SERVER_notification_context_unicast (nc,
line->client,
@@ -895,7 +895,7 @@ handle_mesh_pickup_message (void *cls,
if (NULL == line->tunnel_unreliable)
{
GNUNET_break (0);
- }
+ }
return GNUNET_OK;
}
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h
@@ -127,18 +127,24 @@ enum GNUNET_CONVERSATION_EventCode
GNUNET_CONVERSATION_EC_READY,
/**
- * We failed to locate a phone record in GNS.
+ * We failed to locate a phone record in GNS. After this invocation,
+ * the respective call handle will be automatically destroyed and the
+ * client must no longer call #GNUNET_CONVERSATION_call_stop.
*/
GNUNET_CONVERSATION_EC_GNS_FAIL,
/**
- * The phone is busy. Varargs will be empty.
+ * The phone is busy. Varargs will be empty. After this invocation,
+ * the respective call handle will be automatically destroyed and the
+ * client must no longer call #GNUNET_CONVERSATION_call_stop.
*/
GNUNET_CONVERSATION_EC_BUSY,
/**
- * The conversation was terminated, a reason may be supplied
- * as a `const char *` in the varargs.
+ * The conversation was terminated, a reason may be supplied as a
+ * `const char *` in the varargs. After this invocation, the
+ * respective call handle will be automatically destroyed and the
+ * client must no longer call #GNUNET_CONVERSATION_call_stop.
*/
GNUNET_CONVERSATION_EC_TERMINATED