diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-16 17:13:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-16 17:13:37 +0000 |
commit | 92f8aed964cff174491adbf308974ab09874926b (patch) | |
tree | 537115d586203b856a3ef3ab351a8b783c06c907 | |
parent | a4d350f7de02167577ba8c760f08a0866bc2c9e7 (diff) | |
download | gnunet-92f8aed964cff174491adbf308974ab09874926b.tar.gz gnunet-92f8aed964cff174491adbf308974ab09874926b.zip |
-doxygen, minor bug fixes
-rw-r--r-- | src/conversation/conversation_api.c | 9 | ||||
-rw-r--r-- | src/conversation/conversation_api_call.c | 2 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation.c | 46 | ||||
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 3 | ||||
-rw-r--r-- | src/identity/identity.h | 6 | ||||
-rw-r--r-- | src/identity/identity_api.c | 6 |
6 files changed, 59 insertions, 13 deletions
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index aad272d9c..c8289fe01 100644 --- a/src/conversation/conversation_api.c +++ b/src/conversation/conversation_api.c | |||
@@ -355,11 +355,20 @@ handle_phone_hangup (void *cls, | |||
355 | if (hang->cid == caller->cid) | 355 | if (hang->cid == caller->cid) |
356 | break; | 356 | break; |
357 | if (NULL == caller) | 357 | if (NULL == caller) |
358 | { | ||
359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
360 | "Received HANG_UP message for unknown caller ID %u\n", | ||
361 | (unsigned int) hang->cid); | ||
358 | return; | 362 | return; |
363 | } | ||
359 | 364 | ||
365 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
366 | "Received HANG_UP message, terminating call with `%s'\n", | ||
367 | caller->caller_id_str); | ||
360 | switch (caller->state) | 368 | switch (caller->state) |
361 | { | 369 | { |
362 | case CS_RESOLVE: | 370 | case CS_RESOLVE: |
371 | /* application doesn't even know about call yet */ | ||
363 | GNUNET_NAMESTORE_cancel (caller->qe); | 372 | GNUNET_NAMESTORE_cancel (caller->qe); |
364 | caller->qe = NULL; | 373 | caller->qe = NULL; |
365 | break; | 374 | break; |
diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c index 25e60f0f3..4a671cbda 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) | |||
610 | call->mic->disable_microphone (call->mic->cls); | 610 | call->mic->disable_microphone (call->mic->cls); |
611 | if (CS_SHUTDOWN != call->state) | 611 | if (CS_SHUTDOWN != call->state) |
612 | { | 612 | { |
613 | call->state = CS_SHUTDOWN; | ||
613 | e = GNUNET_MQ_msg (hang, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); | 614 | e = GNUNET_MQ_msg (hang, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); |
614 | GNUNET_MQ_notify_sent (e, &finish_stop, call); | 615 | GNUNET_MQ_notify_sent (e, &finish_stop, call); |
615 | GNUNET_MQ_send (call->mq, e); | 616 | GNUNET_MQ_send (call->mq, e); |
616 | call->state = CS_SHUTDOWN; | ||
617 | return; | 617 | return; |
618 | } | 618 | } |
619 | if (NULL != call->mq) | 619 | if (NULL != call->mq) |
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index 5961046d1..45ecdac91 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -840,6 +840,9 @@ do_resume (const char *args) | |||
840 | static void | 840 | static void |
841 | do_reject (const char *args) | 841 | do_reject (const char *args) |
842 | { | 842 | { |
843 | struct CallList *cl; | ||
844 | char buf[32]; | ||
845 | |||
843 | if (NULL != call) | 846 | if (NULL != call) |
844 | { | 847 | { |
845 | GNUNET_CONVERSATION_call_stop (call); | 848 | GNUNET_CONVERSATION_call_stop (call); |
@@ -849,20 +852,53 @@ do_reject (const char *args) | |||
849 | switch (phone_state) | 852 | switch (phone_state) |
850 | { | 853 | { |
851 | case PS_LOOKUP_EGO: | 854 | case PS_LOOKUP_EGO: |
852 | case PS_LISTEN: | ||
853 | case PS_ERROR: | 855 | case PS_ERROR: |
854 | FPRINTF (stderr, | 856 | FPRINTF (stderr, |
855 | "%s", | 857 | "%s", |
856 | _("There is no call that could be cancelled right now.\n")); | 858 | _("There is no call that could be cancelled right now.\n")); |
857 | return; | 859 | return; |
860 | case PS_LISTEN: | ||
861 | /* look for active incoming calls to refuse */ | ||
862 | cl = cl_head; | ||
863 | if (NULL == cl) | ||
864 | { | ||
865 | FPRINTF (stderr, | ||
866 | _("There is no incoming call to refuse here!\n")); | ||
867 | return; | ||
868 | } | ||
869 | if ( (NULL != cl->next) || (NULL != args) ) | ||
870 | { | ||
871 | for (cl = cl_head; NULL != cl; cl = cl->next) | ||
872 | { | ||
873 | GNUNET_snprintf (buf, sizeof (buf), | ||
874 | "%u", | ||
875 | cl->caller_num); | ||
876 | if (0 == strcmp (buf, args)) | ||
877 | break; | ||
878 | } | ||
879 | } | ||
880 | if (NULL == cl) | ||
881 | { | ||
882 | FPRINTF (stderr, | ||
883 | _("There is no incoming call `%s' to refuse right now!\n"), | ||
884 | args); | ||
885 | return; | ||
886 | } | ||
887 | GNUNET_CONVERSATION_caller_hang_up (cl->caller); | ||
888 | GNUNET_CONTAINER_DLL_remove (cl_head, | ||
889 | cl_tail, | ||
890 | cl); | ||
891 | GNUNET_free (cl->caller_id); | ||
892 | GNUNET_free (cl); | ||
893 | break; | ||
858 | case PS_ACCEPTED: | 894 | case PS_ACCEPTED: |
859 | /* expected state, do rejection logic */ | 895 | /* expected state, do rejection logic */ |
896 | GNUNET_assert (NULL != cl_active); | ||
897 | GNUNET_CONVERSATION_caller_hang_up (cl_active->caller); | ||
898 | cl_active = NULL; | ||
899 | phone_state = PS_LISTEN; | ||
860 | break; | 900 | break; |
861 | } | 901 | } |
862 | GNUNET_assert (NULL != cl_active); | ||
863 | GNUNET_CONVERSATION_caller_hang_up (cl_active->caller); | ||
864 | cl_active = NULL; | ||
865 | phone_state = PS_LISTEN; | ||
866 | } | 902 | } |
867 | 903 | ||
868 | 904 | ||
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 67ac31918..36e8d5060 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -1337,7 +1337,8 @@ inbound_end (void *cls, | |||
1337 | ch->channel_reliable = NULL; | 1337 | ch->channel_reliable = NULL; |
1338 | 1338 | ||
1339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1340 | "Mesh channel destroyed by mesh\n"); | 1340 | "Mesh channel destroyed by mesh in state %d\n", |
1341 | ch->status); | ||
1341 | hup.header.size = sizeof (hup); | 1342 | hup.header.size = sizeof (hup); |
1342 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); | 1343 | hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); |
1343 | hup.cid = ch->cid; | 1344 | hup.cid = ch->cid; |
diff --git a/src/identity/identity.h b/src/identity/identity.h index 09a166591..92a754601 100644 --- a/src/identity/identity.h +++ b/src/identity/identity.h | |||
@@ -68,8 +68,8 @@ struct GNUNET_IDENTITY_UpdateMessage | |||
68 | struct GNUNET_MessageHeader header; | 68 | struct GNUNET_MessageHeader header; |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * Number of bytes in identity name string including 0-termination, in NBO; | 71 | * Number of bytes in ego name string including 0-termination, in NBO; |
72 | * 0 if the identity was deleted. | 72 | * 0 if the ego was deleted. |
73 | */ | 73 | */ |
74 | uint16_t name_len GNUNET_PACKED; | 74 | uint16_t name_len GNUNET_PACKED; |
75 | 75 | ||
@@ -83,7 +83,7 @@ struct GNUNET_IDENTITY_UpdateMessage | |||
83 | */ | 83 | */ |
84 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; | 84 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; |
85 | 85 | ||
86 | /* followed by 0-terminated identity name */ | 86 | /* followed by 0-terminated ego name */ |
87 | 87 | ||
88 | }; | 88 | }; |
89 | 89 | ||
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 1a2b9e4da..3028ff3fd 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c | |||
@@ -87,19 +87,19 @@ struct GNUNET_IDENTITY_Operation | |||
87 | const struct GNUNET_MessageHeader *msg; | 87 | const struct GNUNET_MessageHeader *msg; |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * Continuation to invoke with the result of the transmission; 'cb' | 90 | * Continuation to invoke with the result of the transmission; @e cb |
91 | * will be NULL in this case. | 91 | * will be NULL in this case. |
92 | */ | 92 | */ |
93 | GNUNET_IDENTITY_Continuation cont; | 93 | GNUNET_IDENTITY_Continuation cont; |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Continuation to invoke with the result of the transmission for | 96 | * Continuation to invoke with the result of the transmission for |
97 | * 'get' operations ('cont' will be NULL in this case). | 97 | * 'get' operations (@e cont will be NULL in this case). |
98 | */ | 98 | */ |
99 | GNUNET_IDENTITY_Callback cb; | 99 | GNUNET_IDENTITY_Callback cb; |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * Closure for 'cont' or 'cb'. | 102 | * Closure for @e cont or @e cb. |
103 | */ | 103 | */ |
104 | void *cls; | 104 | void *cls; |
105 | 105 | ||