[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30745 - in gnunet/src: conversation identity
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30745 - in gnunet/src: conversation identity |
Date: |
Sat, 16 Nov 2013 18:13:37 +0100 |
Author: grothoff
Date: 2013-11-16 18:13:37 +0100 (Sat, 16 Nov 2013)
New Revision: 30745
Modified:
gnunet/src/conversation/conversation_api.c
gnunet/src/conversation/conversation_api_call.c
gnunet/src/conversation/gnunet-conversation.c
gnunet/src/conversation/gnunet-service-conversation.c
gnunet/src/identity/identity.h
gnunet/src/identity/identity_api.c
Log:
-doxygen, minor bug fixes
Modified: gnunet/src/conversation/conversation_api.c
===================================================================
--- gnunet/src/conversation/conversation_api.c 2013-11-16 15:25:43 UTC (rev
30744)
+++ gnunet/src/conversation/conversation_api.c 2013-11-16 17:13:37 UTC (rev
30745)
@@ -355,11 +355,20 @@
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;
Modified: gnunet/src/conversation/conversation_api_call.c
===================================================================
--- gnunet/src/conversation/conversation_api_call.c 2013-11-16 15:25:43 UTC
(rev 30744)
+++ gnunet/src/conversation/conversation_api_call.c 2013-11-16 17:13:37 UTC
(rev 30745)
@@ -610,10 +610,10 @@
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)
Modified: gnunet/src/conversation/gnunet-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-conversation.c 2013-11-16 15:25:43 UTC
(rev 30744)
+++ gnunet/src/conversation/gnunet-conversation.c 2013-11-16 17:13:37 UTC
(rev 30745)
@@ -840,6 +840,9 @@
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 @@
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;
}
Modified: gnunet/src/conversation/gnunet-service-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-service-conversation.c 2013-11-16
15:25:43 UTC (rev 30744)
+++ gnunet/src/conversation/gnunet-service-conversation.c 2013-11-16
17:13:37 UTC (rev 30745)
@@ -1337,7 +1337,8 @@
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;
Modified: gnunet/src/identity/identity.h
===================================================================
--- gnunet/src/identity/identity.h 2013-11-16 15:25:43 UTC (rev 30744)
+++ gnunet/src/identity/identity.h 2013-11-16 17:13:37 UTC (rev 30745)
@@ -68,8 +68,8 @@
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_CRYPTO_EcdsaPrivateKey private_key;
- /* followed by 0-terminated identity name */
+ /* followed by 0-terminated ego name */
};
Modified: gnunet/src/identity/identity_api.c
===================================================================
--- gnunet/src/identity/identity_api.c 2013-11-16 15:25:43 UTC (rev 30744)
+++ gnunet/src/identity/identity_api.c 2013-11-16 17:13:37 UTC (rev 30745)
@@ -87,19 +87,19 @@
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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30745 - in gnunet/src: conversation identity,
gnunet <=