aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-16 17:13:37 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-16 17:13:37 +0000
commit92f8aed964cff174491adbf308974ab09874926b (patch)
tree537115d586203b856a3ef3ab351a8b783c06c907
parenta4d350f7de02167577ba8c760f08a0866bc2c9e7 (diff)
-doxygen, minor bug fixes
-rw-r--r--src/conversation/conversation_api.c9
-rw-r--r--src/conversation/conversation_api_call.c2
-rw-r--r--src/conversation/gnunet-conversation.c46
-rw-r--r--src/conversation/gnunet-service-conversation.c3
-rw-r--r--src/identity/identity.h6
-rw-r--r--src/identity/identity_api.c6
6 files changed, 59 insertions, 13 deletions
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index aad272d9c7..c8289fe01f 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -355,11 +355,20 @@ handle_phone_hangup (void *cls,
if (hang->cid == caller->cid)
break;
if (NULL == caller)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received HANG_UP message for unknown caller ID %u\n",
+ (unsigned int) hang->cid);
return;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received HANG_UP message, terminating call with `%s'\n",
+ caller->caller_id_str);
switch (caller->state)
{
case CS_RESOLVE:
+ /* application doesn't even know about call yet */
GNUNET_NAMESTORE_cancel (caller->qe);
caller->qe = NULL;
break;
diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c
index 25e60f0f3a..4a671cbda7 100644
--- a/src/conversation/conversation_api_call.c
+++ b/src/conversation/conversation_api_call.c
@@ -610,10 +610,10 @@ GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call)
call->mic->disable_microphone (call->mic->cls);
if (CS_SHUTDOWN != call->state)
{
+ call->state = CS_SHUTDOWN;
e = GNUNET_MQ_msg (hang, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
GNUNET_MQ_notify_sent (e, &finish_stop, call);
GNUNET_MQ_send (call->mq, e);
- call->state = CS_SHUTDOWN;
return;
}
if (NULL != call->mq)
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 5961046d18..45ecdac916 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -840,6 +840,9 @@ do_resume (const char *args)
static void
do_reject (const char *args)
{
+ struct CallList *cl;
+ char buf[32];
+
if (NULL != call)
{
GNUNET_CONVERSATION_call_stop (call);
@@ -849,20 +852,53 @@ do_reject (const char *args)
switch (phone_state)
{
case PS_LOOKUP_EGO:
- case PS_LISTEN:
case PS_ERROR:
FPRINTF (stderr,
"%s",
_("There is no call that could be cancelled right now.\n"));
return;
+ case PS_LISTEN:
+ /* look for active incoming calls to refuse */
+ cl = cl_head;
+ if (NULL == cl)
+ {
+ FPRINTF (stderr,
+ _("There is no incoming call to refuse here!\n"));
+ return;
+ }
+ if ( (NULL != cl->next) || (NULL != args) )
+ {
+ for (cl = cl_head; NULL != cl; cl = cl->next)
+ {
+ GNUNET_snprintf (buf, sizeof (buf),
+ "%u",
+ cl->caller_num);
+ if (0 == strcmp (buf, args))
+ break;
+ }
+ }
+ if (NULL == cl)
+ {
+ FPRINTF (stderr,
+ _("There is no incoming call `%s' to refuse right now!\n"),
+ args);
+ return;
+ }
+ GNUNET_CONVERSATION_caller_hang_up (cl->caller);
+ GNUNET_CONTAINER_DLL_remove (cl_head,
+ cl_tail,
+ cl);
+ GNUNET_free (cl->caller_id);
+ GNUNET_free (cl);
+ break;
case PS_ACCEPTED:
/* expected state, do rejection logic */
+ GNUNET_assert (NULL != cl_active);
+ GNUNET_CONVERSATION_caller_hang_up (cl_active->caller);
+ cl_active = NULL;
+ phone_state = PS_LISTEN;
break;
}
- GNUNET_assert (NULL != cl_active);
- GNUNET_CONVERSATION_caller_hang_up (cl_active->caller);
- cl_active = NULL;
- phone_state = PS_LISTEN;
}
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 67ac319186..36e8d5060f 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -1337,7 +1337,8 @@ inbound_end (void *cls,
ch->channel_reliable = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Mesh channel destroyed by mesh\n");
+ "Mesh channel destroyed by mesh in state %d\n",
+ ch->status);
hup.header.size = sizeof (hup);
hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
hup.cid = ch->cid;
diff --git a/src/identity/identity.h b/src/identity/identity.h
index 09a166591f..92a7546018 100644
--- a/src/identity/identity.h
+++ b/src/identity/identity.h
@@ -68,8 +68,8 @@ struct GNUNET_IDENTITY_UpdateMessage
struct GNUNET_MessageHeader header;
/**
- * Number of bytes in identity name string including 0-termination, in NBO;
- * 0 if the identity was deleted.
+ * Number of bytes in ego name string including 0-termination, in NBO;
+ * 0 if the ego was deleted.
*/
uint16_t name_len GNUNET_PACKED;
@@ -83,7 +83,7 @@ struct GNUNET_IDENTITY_UpdateMessage
*/
struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
- /* followed by 0-terminated identity name */
+ /* followed by 0-terminated ego name */
};
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 1a2b9e4da1..3028ff3fd4 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -87,19 +87,19 @@ struct GNUNET_IDENTITY_Operation
const struct GNUNET_MessageHeader *msg;
/**
- * Continuation to invoke with the result of the transmission; 'cb'
+ * Continuation to invoke with the result of the transmission; @e cb
* will be NULL in this case.
*/
GNUNET_IDENTITY_Continuation cont;
/**
* Continuation to invoke with the result of the transmission for
- * 'get' operations ('cont' will be NULL in this case).
+ * 'get' operations (@e cont will be NULL in this case).
*/
GNUNET_IDENTITY_Callback cb;
/**
- * Closure for 'cont' or 'cb'.
+ * Closure for @e cont or @e cb.
*/
void *cls;