diff options
author | t3sserakt <t3ss@posteo.de> | 2017-11-02 18:15:13 +0100 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2017-11-02 18:15:13 +0100 |
commit | bf2169967b3c5a4a553c133a00dd7d35289f7a9d (patch) | |
tree | c415df9e87ce7cc03cfe6dff3024dfe21d61ec8f | |
parent | ea5102e5ef870b7ed90aebfe44a4caa1148d57df (diff) | |
parent | 7c1ce9a71e362727509f013900a50ba5879ca8b2 (diff) | |
download | gnunet-bf2169967b3c5a4a553c133a00dd7d35289f7a9d.tar.gz gnunet-bf2169967b3c5a4a553c133a00dd7d35289f7a9d.zip |
Merge branch 'fix_social' of gnunet.org:gnunet into fix_social
26 files changed, 207 insertions, 104 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c index 22e19ef70..fb91a4a6a 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.c +++ b/src/cadet/gnunet-service-cadet_tunnels.c | |||
@@ -2856,7 +2856,9 @@ handle_plaintext_channel_destroy (void *cls, | |||
2856 | * | 2856 | * |
2857 | * @param cls the `struct CadetTunnel` that got the message | 2857 | * @param cls the `struct CadetTunnel` that got the message |
2858 | * @param msg the message | 2858 | * @param msg the message |
2859 | * @return #GNUNET_OK (continue to process) | 2859 | * @return #GNUNET_OK on success (always) |
2860 | * #GNUNET_NO to stop further processing (no error) | ||
2861 | * #GNUNET_SYSERR to stop further processing with error | ||
2860 | */ | 2862 | */ |
2861 | static int | 2863 | static int |
2862 | handle_decrypted (void *cls, | 2864 | handle_decrypted (void *cls, |
diff --git a/src/conversation/gnunet-helper-audio-playback-gst.c b/src/conversation/gnunet-helper-audio-playback-gst.c index 264b14e76..002fed6c7 100644 --- a/src/conversation/gnunet-helper-audio-playback-gst.c +++ b/src/conversation/gnunet-helper-audio-playback-gst.c | |||
@@ -221,6 +221,11 @@ feed_buffer_to_gst (const char *audio, size_t b_len) | |||
221 | 221 | ||
222 | /** | 222 | /** |
223 | * Message callback | 223 | * Message callback |
224 | * | ||
225 | * @param msg message we received. | ||
226 | * @return #GNUNET_OK on success, | ||
227 | * #GNUNET_NO to stop further processing due to disconnect (no error) | ||
228 | * #GNUNET_SYSERR to stop further processing due to error | ||
224 | */ | 229 | */ |
225 | static int | 230 | static int |
226 | stdin_receiver (void *cls, | 231 | stdin_receiver (void *cls, |
diff --git a/src/conversation/gnunet-helper-audio-playback.c b/src/conversation/gnunet-helper-audio-playback.c index 4344e1d41..18f63ad18 100644 --- a/src/conversation/gnunet-helper-audio-playback.c +++ b/src/conversation/gnunet-helper-audio-playback.c | |||
@@ -546,6 +546,11 @@ ogg_demux_and_decode () | |||
546 | 546 | ||
547 | /** | 547 | /** |
548 | * Message callback | 548 | * Message callback |
549 | * | ||
550 | * @param msg message we received. | ||
551 | * @return #GNUNET_OK on success, | ||
552 | * #GNUNET_NO to stop further processing due to disconnect (no error) | ||
553 | * #GNUNET_SYSERR to stop further processing due to error | ||
549 | */ | 554 | */ |
550 | static int | 555 | static int |
551 | stdin_receiver (void *cls, | 556 | stdin_receiver (void *cls, |
diff --git a/src/conversation/gnunet_gst.c b/src/conversation/gnunet_gst.c index 52cb2ccbc..828b35077 100644 --- a/src/conversation/gnunet_gst.c +++ b/src/conversation/gnunet_gst.c | |||
@@ -649,6 +649,11 @@ gnunet_read (GNUNET_gstData * d) | |||
649 | 649 | ||
650 | /** | 650 | /** |
651 | * Message callback | 651 | * Message callback |
652 | * | ||
653 | * @param msg message we received. | ||
654 | * @return #GNUNET_OK on success, | ||
655 | * #GNUNET_NO to stop further processing due to disconnect (no error) | ||
656 | * #GNUNET_SYSERR to stop further processing due to error | ||
652 | */ | 657 | */ |
653 | static int | 658 | static int |
654 | stdin_receiver (void *cls, | 659 | stdin_receiver (void *cls, |
diff --git a/src/conversation/microphone.c b/src/conversation/microphone.c index 7871433a3..11468fc59 100644 --- a/src/conversation/microphone.c +++ b/src/conversation/microphone.c | |||
@@ -65,7 +65,9 @@ struct Microphone | |||
65 | * | 65 | * |
66 | * @param cls clsoure with our `struct Microphone` | 66 | * @param cls clsoure with our `struct Microphone` |
67 | * @param msg the message from the helper | 67 | * @param msg the message from the helper |
68 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 68 | * @return #GNUNET_OK on success, |
69 | * #GNUNET_NO to stop further processing (no error) | ||
70 | * #GNUNET_SYSERR to stop further processing with error | ||
69 | */ | 71 | */ |
70 | static int | 72 | static int |
71 | process_record_messages (void *cls, | 73 | process_record_messages (void *cls, |
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 625bf9655..214f72904 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -426,6 +426,9 @@ struct TokenizerContext | |||
426 | * | 426 | * |
427 | * @param cls reservation request (`struct TokenizerContext`) | 427 | * @param cls reservation request (`struct TokenizerContext`) |
428 | * @param message the actual message | 428 | * @param message the actual message |
429 | * @return #GNUNET_OK on success, | ||
430 | * #GNUNET_NO to stop further processing (no error) | ||
431 | * #GNUNET_SYSERR to stop further processing with error | ||
429 | */ | 432 | */ |
430 | static int | 433 | static int |
431 | tokenized_cb (void *cls, | 434 | tokenized_cb (void *cls, |
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index 8a7cada5c..ae0ae508f 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c | |||
@@ -708,6 +708,9 @@ setup_fresh_ping (struct GSC_KeyExchangeInfo *kx) | |||
708 | * | 708 | * |
709 | * @param cls the `struct GSC_KeyExchangeInfo` | 709 | * @param cls the `struct GSC_KeyExchangeInfo` |
710 | * @param m the message | 710 | * @param m the message |
711 | * @return #GNUNET_OK on success, | ||
712 | * #GNUNET_NO to stop further processing (no error) | ||
713 | * #GNUNET_SYSERR to stop further processing with error | ||
711 | */ | 714 | */ |
712 | static int | 715 | static int |
713 | deliver_message (void *cls, | 716 | deliver_message (void *cls, |
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c index 7b9f178fd..8a3e37b49 100644 --- a/src/fs/fs_dirmetascan.c +++ b/src/fs/fs_dirmetascan.c | |||
@@ -246,6 +246,9 @@ finish_scan (void *cls) | |||
246 | * | 246 | * |
247 | * @param cls the closure (directory scanner object) | 247 | * @param cls the closure (directory scanner object) |
248 | * @param msg message from the helper process | 248 | * @param msg message from the helper process |
249 | * @return #GNUNET_OK on success, | ||
250 | * #GNUNET_NO to stop further processing (no error) | ||
251 | * #GNUNET_SYSERR to stop further processing with error | ||
249 | */ | 252 | */ |
250 | static int | 253 | static int |
251 | process_helper_msgs (void *cls, | 254 | process_helper_msgs (void *cls, |
diff --git a/src/include/gnunet_mst_lib.h b/src/include/gnunet_mst_lib.h index 7a1ca7a55..fe6524eb3 100644 --- a/src/include/gnunet_mst_lib.h +++ b/src/include/gnunet_mst_lib.h | |||
@@ -61,7 +61,9 @@ struct GNUNET_MessageStreamTokenizer; | |||
61 | * | 61 | * |
62 | * @param cls closure | 62 | * @param cls closure |
63 | * @param message the actual message | 63 | * @param message the actual message |
64 | * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing | 64 | * @return #GNUNET_OK on success, |
65 | * #GNUNET_NO to stop further processing due to disconnect (no error) | ||
66 | * #GNUNET_SYSERR to stop further processing due to error | ||
65 | */ | 67 | */ |
66 | typedef int | 68 | typedef int |
67 | (*GNUNET_MessageTokenizerCallback) (void *cls, | 69 | (*GNUNET_MessageTokenizerCallback) (void *cls, |
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index aacafe956..dda827c95 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h | |||
@@ -366,11 +366,16 @@ GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c) | |||
366 | /** | 366 | /** |
367 | * Ask the server to disconnect from the given client. This is the | 367 | * Ask the server to disconnect from the given client. This is the |
368 | * same as returning #GNUNET_SYSERR within the check procedure when | 368 | * same as returning #GNUNET_SYSERR within the check procedure when |
369 | * handling a message, wexcept that it allows dropping of a client even | 369 | * handling a message, except that it allows dropping of a client even |
370 | * when not handling a message from that client. The `disconnect_cb` | 370 | * when not handling a message from that client. The `disconnect_cb` |
371 | * will be called on @a c even if the application closes the connection | 371 | * will be called on @a c even if the application closes the connection |
372 | * using this function. | 372 | * using this function. |
373 | * | 373 | * |
374 | * This function should be called (outside of util's internal logic) | ||
375 | * if (and usually only if) the client has violated the | ||
376 | * protocol. Otherwise, we should leave it to the client to disconnect | ||
377 | * from the service. | ||
378 | * | ||
374 | * @param c client to disconnect now | 379 | * @param c client to disconnect now |
375 | */ | 380 | */ |
376 | void | 381 | void |
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index c93d8b383..e7790d201 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c | |||
@@ -931,7 +931,8 @@ slave_reconnect (void *cls) | |||
931 | * Reconnect after backoff period. | 931 | * Reconnect after backoff period. |
932 | */ | 932 | */ |
933 | static void | 933 | static void |
934 | slave_disconnected (void *cls, enum GNUNET_MQ_Error error) | 934 | slave_disconnected (void *cls, |
935 | enum GNUNET_MQ_Error error) | ||
935 | { | 936 | { |
936 | struct GNUNET_PSYC_Slave *slv = cls; | 937 | struct GNUNET_PSYC_Slave *slv = cls; |
937 | struct GNUNET_PSYC_Channel *chn = &slv->chn; | 938 | struct GNUNET_PSYC_Channel *chn = &slv->chn; |
@@ -950,7 +951,7 @@ slave_disconnected (void *cls, enum GNUNET_MQ_Error error) | |||
950 | chn->mq = NULL; | 951 | chn->mq = NULL; |
951 | } | 952 | } |
952 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, | 953 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, |
953 | slave_reconnect, | 954 | &slave_reconnect, |
954 | slv); | 955 | slv); |
955 | chn->reconnect_delay = GNUNET_TIME_STD_BACKOFF (chn->reconnect_delay); | 956 | chn->reconnect_delay = GNUNET_TIME_STD_BACKOFF (chn->reconnect_delay); |
956 | } | 957 | } |
@@ -993,9 +994,19 @@ slave_connect (struct GNUNET_PSYC_Slave *slv) | |||
993 | GNUNET_MQ_handler_end () | 994 | GNUNET_MQ_handler_end () |
994 | }; | 995 | }; |
995 | 996 | ||
996 | chn->mq = GNUNET_CLIENT_connect (chn->cfg, "psyc", | 997 | chn->mq = GNUNET_CLIENT_connect (chn->cfg, |
997 | handlers, slave_disconnected, slv); | 998 | "psyc", |
998 | GNUNET_assert (NULL != chn->mq); | 999 | handlers, |
1000 | &slave_disconnected, | ||
1001 | slv); | ||
1002 | if (NULL == chn->mq) | ||
1003 | { | ||
1004 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, | ||
1005 | &slave_reconnect, | ||
1006 | slv); | ||
1007 | chn->reconnect_delay = GNUNET_TIME_STD_BACKOFF (chn->reconnect_delay); | ||
1008 | return; | ||
1009 | } | ||
999 | chn->tmit = GNUNET_PSYC_transmit_create (chn->mq); | 1010 | chn->tmit = GNUNET_PSYC_transmit_create (chn->mq); |
1000 | 1011 | ||
1001 | GNUNET_MQ_send_copy (chn->mq, chn->connect_env); | 1012 | GNUNET_MQ_send_copy (chn->mq, chn->connect_env); |
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c index f9e70a25d..04bbba192 100644 --- a/src/social/gnunet-service-social.c +++ b/src/social/gnunet-service-social.c | |||
@@ -570,7 +570,6 @@ client_notify_disconnect (void *cls, | |||
570 | 570 | ||
571 | if (NULL != c->app_id) | 571 | if (NULL != c->app_id) |
572 | GNUNET_free (c->app_id); | 572 | GNUNET_free (c->app_id); |
573 | |||
574 | GNUNET_free (c); | 573 | GNUNET_free (c); |
575 | 574 | ||
576 | if (NULL == plc) | 575 | if (NULL == plc) |
@@ -586,7 +585,9 @@ client_notify_disconnect (void *cls, | |||
586 | { | 585 | { |
587 | if (cli->client == client) | 586 | if (cli->client == client) |
588 | { | 587 | { |
589 | GNUNET_CONTAINER_DLL_remove (plc->clients_head, plc->clients_tail, cli); | 588 | GNUNET_CONTAINER_DLL_remove (plc->clients_head, |
589 | plc->clients_tail, | ||
590 | cli); | ||
590 | GNUNET_free (cli); | 591 | GNUNET_free (cli); |
591 | break; | 592 | break; |
592 | } | 593 | } |
@@ -608,11 +609,13 @@ client_notify_connect (void *cls, | |||
608 | struct GNUNET_SERVICE_Client *client, | 609 | struct GNUNET_SERVICE_Client *client, |
609 | struct GNUNET_MQ_Handle *mq) | 610 | struct GNUNET_MQ_Handle *mq) |
610 | { | 611 | { |
611 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client connected: %p\n", client); | 612 | struct Client *c = GNUNET_new (struct Client); |
612 | 613 | ||
613 | struct Client *c = GNUNET_malloc (sizeof (*c)); | 614 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
615 | "Client %p connected with queue %p\n", | ||
616 | client, | ||
617 | mq); | ||
614 | c->client = client; | 618 | c->client = client; |
615 | |||
616 | return c; | 619 | return c; |
617 | } | 620 | } |
618 | 621 | ||
@@ -2204,7 +2207,7 @@ handle_client_app_detach (void *cls, | |||
2204 | } | 2207 | } |
2205 | 2208 | ||
2206 | 2209 | ||
2207 | int | 2210 | static int |
2208 | app_places_entry_remove (void *cls, const struct GNUNET_HashCode *key, void *value) | 2211 | app_places_entry_remove (void *cls, const struct GNUNET_HashCode *key, void *value) |
2209 | { | 2212 | { |
2210 | struct Place *plc = cls; | 2213 | struct Place *plc = cls; |
@@ -2247,15 +2250,14 @@ handle_client_place_leave (void *cls, | |||
2247 | /* FIXME: disconnect from the network, but keep local connection for history access */ | 2250 | /* FIXME: disconnect from the network, but keep local connection for history access */ |
2248 | 2251 | ||
2249 | /* Disconnect all clients connected to the place */ | 2252 | /* Disconnect all clients connected to the place */ |
2250 | struct ClientListItem *cli = plc->clients_head, *next; | 2253 | |
2251 | while (NULL != cli) | 2254 | for (struct ClientListItem *cli = plc->clients_head; |
2255 | NULL != cli; | ||
2256 | cli = cli->next) | ||
2252 | { | 2257 | { |
2253 | GNUNET_CONTAINER_DLL_remove (plc->clients_head, plc->clients_tail, cli); | ||
2254 | // protocol design failure: should *tell* clients that room is gone! | 2258 | // protocol design failure: should *tell* clients that room is gone! |
2255 | GNUNET_SERVICE_client_drop (cli->client); | 2259 | if (client != cli->client) |
2256 | next = cli->next; | 2260 | GNUNET_SERVICE_client_drop (cli->client); |
2257 | GNUNET_free (cli); | ||
2258 | cli = next; | ||
2259 | } | 2261 | } |
2260 | 2262 | ||
2261 | if (GNUNET_YES != plc->is_disconnected) | 2263 | if (GNUNET_YES != plc->is_disconnected) |
@@ -2268,10 +2270,11 @@ handle_client_place_leave (void *cls, | |||
2268 | else | 2270 | else |
2269 | { | 2271 | { |
2270 | cleanup_place (plc); | 2272 | cleanup_place (plc); |
2273 | c->place = NULL; | ||
2271 | } | 2274 | } |
2272 | } | 2275 | } |
2273 | // FIXME: can't continue+drop above, but should not drop above! | 2276 | // FIXME: can't continue+drop above, but should not drop above! |
2274 | // GNUNET_SERVICE_client_continue (client); | 2277 | GNUNET_SERVICE_client_continue (client); |
2275 | } | 2278 | } |
2276 | 2279 | ||
2277 | 2280 | ||
@@ -2989,7 +2992,6 @@ handle_client_psyc_message (void *cls, | |||
2989 | "%p Received message with invalid payload size (%u) from client.\n", | 2992 | "%p Received message with invalid payload size (%u) from client.\n", |
2990 | plc, psize); | 2993 | plc, psize); |
2991 | GNUNET_break (0); | 2994 | GNUNET_break (0); |
2992 | psyc_transmit_cancel (plc, client); | ||
2993 | GNUNET_SERVICE_client_drop (client); | 2995 | GNUNET_SERVICE_client_drop (client); |
2994 | return; | 2996 | return; |
2995 | } | 2997 | } |
@@ -3003,7 +3005,6 @@ handle_client_psyc_message (void *cls, | |||
3003 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 3005 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
3004 | "%p Received invalid message part from client.\n", plc); | 3006 | "%p Received invalid message part from client.\n", plc); |
3005 | GNUNET_break (0); | 3007 | GNUNET_break (0); |
3006 | psyc_transmit_cancel (plc, client); | ||
3007 | GNUNET_SERVICE_client_drop (client); | 3008 | GNUNET_SERVICE_client_drop (client); |
3008 | return; | 3009 | return; |
3009 | } | 3010 | } |
@@ -3029,7 +3030,6 @@ handle_client_psyc_message (void *cls, | |||
3029 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 3030 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
3030 | "%p Received invalid message part from client.\n", plc); | 3031 | "%p Received invalid message part from client.\n", plc); |
3031 | GNUNET_break (0); | 3032 | GNUNET_break (0); |
3032 | psyc_transmit_cancel (plc, client); | ||
3033 | ret = GNUNET_SYSERR; | 3033 | ret = GNUNET_SYSERR; |
3034 | } | 3034 | } |
3035 | 3035 | ||
diff --git a/src/social/social_api.c b/src/social/social_api.c index fc649fcde..1db8e501a 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c | |||
@@ -1044,6 +1044,7 @@ static void | |||
1044 | place_cleanup (struct GNUNET_SOCIAL_Place *plc) | 1044 | place_cleanup (struct GNUNET_SOCIAL_Place *plc) |
1045 | { | 1045 | { |
1046 | struct GNUNET_HashCode place_pub_hash; | 1046 | struct GNUNET_HashCode place_pub_hash; |
1047 | |||
1047 | GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash); | 1048 | GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash); |
1048 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1049 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1049 | "%s place cleanup: %s\n", | 1050 | "%s place cleanup: %s\n", |
@@ -2092,6 +2093,8 @@ leave_done_cont (void *cls) | |||
2092 | { | 2093 | { |
2093 | struct LeaveContext *lc = cls; | 2094 | struct LeaveContext *lc = cls; |
2094 | 2095 | ||
2096 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
2097 | "social_api: guest's place_leave message sent!\n"); | ||
2095 | GNUNET_SOCIAL_guest_disconnect (lc->gst, | 2098 | GNUNET_SOCIAL_guest_disconnect (lc->gst, |
2096 | lc->disconnect_cb, | 2099 | lc->disconnect_cb, |
2097 | lc->disconnect_cb_cls); | 2100 | lc->disconnect_cb_cls); |
diff --git a/src/social/test_social.c b/src/social/test_social.c index 8d49e7413..de2299320 100644 --- a/src/social/test_social.c +++ b/src/social/test_social.c | |||
@@ -180,10 +180,28 @@ host_announce2 (); | |||
180 | 180 | ||
181 | 181 | ||
182 | /** | 182 | /** |
183 | * Clean up all resources used. | 183 | * Terminate the test case (failure). |
184 | * | ||
185 | * @param cls NULL | ||
184 | */ | 186 | */ |
185 | static void | 187 | static void |
186 | cleanup () | 188 | end_badly (void *cls) |
189 | { | ||
190 | end_badly_task = NULL; | ||
191 | GNUNET_SCHEDULER_shutdown (); | ||
192 | res = 2; | ||
193 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
194 | "Test FAILED.\n"); | ||
195 | } | ||
196 | |||
197 | |||
198 | /** | ||
199 | * Terminate the test case (failure). | ||
200 | * | ||
201 | * @param cls NULL | ||
202 | */ | ||
203 | static void | ||
204 | end_shutdown (void *cls) | ||
187 | { | 205 | { |
188 | if (NULL != id) | 206 | if (NULL != id) |
189 | { | 207 | { |
@@ -202,7 +220,11 @@ cleanup () | |||
202 | GNUNET_PSYC_slicer_destroy (host_slicer); | 220 | GNUNET_PSYC_slicer_destroy (host_slicer); |
203 | host_slicer = NULL; | 221 | host_slicer = NULL; |
204 | } | 222 | } |
205 | 223 | if (NULL != end_badly_task) | |
224 | { | ||
225 | GNUNET_SCHEDULER_cancel (end_badly_task); | ||
226 | end_badly_task = NULL; | ||
227 | } | ||
206 | if (NULL != gst) | 228 | if (NULL != gst) |
207 | { | 229 | { |
208 | GNUNET_SOCIAL_guest_leave (gst, NULL, NULL, NULL); | 230 | GNUNET_SOCIAL_guest_leave (gst, NULL, NULL, NULL); |
@@ -216,21 +238,6 @@ cleanup () | |||
216 | hst_plc = NULL; | 238 | hst_plc = NULL; |
217 | } | 239 | } |
218 | GNUNET_SOCIAL_app_disconnect (app, NULL, NULL); | 240 | GNUNET_SOCIAL_app_disconnect (app, NULL, NULL); |
219 | GNUNET_SCHEDULER_shutdown (); | ||
220 | } | ||
221 | |||
222 | |||
223 | /** | ||
224 | * Terminate the test case (failure). | ||
225 | * | ||
226 | * @param cls NULL | ||
227 | */ | ||
228 | static void | ||
229 | end_badly (void *cls) | ||
230 | { | ||
231 | res = 1; | ||
232 | cleanup (); | ||
233 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test FAILED.\n"); | ||
234 | } | 241 | } |
235 | 242 | ||
236 | 243 | ||
@@ -242,8 +249,8 @@ end_badly (void *cls) | |||
242 | static void | 249 | static void |
243 | end_normally (void *cls) | 250 | end_normally (void *cls) |
244 | { | 251 | { |
252 | GNUNET_SCHEDULER_shutdown (); | ||
245 | res = 0; | 253 | res = 0; |
246 | cleanup (); | ||
247 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Test PASSED.\n"); | 254 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Test PASSED.\n"); |
248 | } | 255 | } |
249 | 256 | ||
@@ -372,6 +379,7 @@ host_reconnected (void *cls, int result, | |||
372 | is_host_reconnected = GNUNET_YES; | 379 | is_host_reconnected = GNUNET_YES; |
373 | if (GNUNET_YES == is_guest_reconnected) | 380 | if (GNUNET_YES == is_guest_reconnected) |
374 | { | 381 | { |
382 | GNUNET_assert (NULL != gst); | ||
375 | GNUNET_SCHEDULER_add_now (&schedule_guest_leave, NULL); | 383 | GNUNET_SCHEDULER_add_now (&schedule_guest_leave, NULL); |
376 | } | 384 | } |
377 | } | 385 | } |
@@ -390,6 +398,7 @@ guest_reconnected (void *cls, int result, | |||
390 | is_guest_reconnected = GNUNET_YES; | 398 | is_guest_reconnected = GNUNET_YES; |
391 | if (GNUNET_YES == is_host_reconnected) | 399 | if (GNUNET_YES == is_host_reconnected) |
392 | { | 400 | { |
401 | GNUNET_assert (NULL != gst); | ||
393 | GNUNET_SCHEDULER_add_now (&schedule_guest_leave, NULL); | 402 | GNUNET_SCHEDULER_add_now (&schedule_guest_leave, NULL); |
394 | } | 403 | } |
395 | } | 404 | } |
@@ -411,11 +420,15 @@ app_recv_host (void *cls, | |||
411 | enum GNUNET_SOCIAL_AppPlaceState place_state) | 420 | enum GNUNET_SOCIAL_AppPlaceState place_state) |
412 | { | 421 | { |
413 | struct GNUNET_HashCode host_pub_hash; | 422 | struct GNUNET_HashCode host_pub_hash; |
414 | GNUNET_CRYPTO_hash (host_pub_key, sizeof (*host_pub_key), &host_pub_hash); | 423 | |
424 | GNUNET_CRYPTO_hash (host_pub_key, | ||
425 | sizeof (*host_pub_key), | ||
426 | &host_pub_hash); | ||
415 | 427 | ||
416 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 428 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
417 | "Test #%u: Got app host place notification: %s\n", | 429 | "Test #%u: Got app host place notification: %s\n", |
418 | test, GNUNET_h2s (&host_pub_hash)); | 430 | test, |
431 | GNUNET_h2s (&host_pub_hash)); | ||
419 | 432 | ||
420 | if (test == TEST_RECONNECT) | 433 | if (test == TEST_RECONNECT) |
421 | { | 434 | { |
@@ -424,8 +437,11 @@ app_recv_host (void *cls, | |||
424 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 437 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
425 | "Test #%u: Reconnecting to host place: %s\n", | 438 | "Test #%u: Reconnecting to host place: %s\n", |
426 | test, GNUNET_h2s (&host_pub_hash)); | 439 | test, GNUNET_h2s (&host_pub_hash)); |
427 | hst = GNUNET_SOCIAL_host_enter_reconnect (hconn, host_slicer, host_reconnected, | 440 | hst = GNUNET_SOCIAL_host_enter_reconnect (hconn, host_slicer, |
428 | host_answer_door, host_farewell2, NULL); | 441 | &host_reconnected, |
442 | &host_answer_door, | ||
443 | &host_farewell2, | ||
444 | NULL); | ||
429 | } | 445 | } |
430 | } | 446 | } |
431 | } | 447 | } |
@@ -439,7 +455,10 @@ app_recv_guest (void *cls, | |||
439 | enum GNUNET_SOCIAL_AppPlaceState place_state) | 455 | enum GNUNET_SOCIAL_AppPlaceState place_state) |
440 | { | 456 | { |
441 | struct GNUNET_HashCode guest_pub_hash; | 457 | struct GNUNET_HashCode guest_pub_hash; |
442 | GNUNET_CRYPTO_hash (guest_pub_key, sizeof (*guest_pub_key), &guest_pub_hash); | 458 | |
459 | GNUNET_CRYPTO_hash (guest_pub_key, | ||
460 | sizeof (*guest_pub_key), | ||
461 | &guest_pub_hash); | ||
443 | 462 | ||
444 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 463 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
445 | "Test #%u: Got app guest place notification: %s\n", | 464 | "Test #%u: Got app guest place notification: %s\n", |
@@ -447,13 +466,19 @@ app_recv_guest (void *cls, | |||
447 | 466 | ||
448 | if (test == TEST_RECONNECT) | 467 | if (test == TEST_RECONNECT) |
449 | { | 468 | { |
450 | if (0 == memcmp (&place_pub_key, guest_pub_key, sizeof (*guest_pub_key))) | 469 | if (0 == memcmp (&place_pub_key, |
470 | guest_pub_key, | ||
471 | sizeof (*guest_pub_key))) | ||
451 | { | 472 | { |
452 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 473 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
453 | "Test #%u: Reconnecting to guest place: %s\n", | 474 | "Test #%u: Reconnecting to guest place: %s\n", |
454 | test, GNUNET_h2s (&guest_pub_hash)); | 475 | test, GNUNET_h2s (&guest_pub_hash)); |
455 | gst = GNUNET_SOCIAL_guest_enter_reconnect (gconn, GNUNET_PSYC_SLAVE_JOIN_NONE, | 476 | gst = GNUNET_SOCIAL_guest_enter_reconnect (gconn, |
456 | guest_slicer, guest_reconnected, NULL); | 477 | GNUNET_PSYC_SLAVE_JOIN_NONE, |
478 | guest_slicer, | ||
479 | &guest_reconnected, | ||
480 | NULL); | ||
481 | GNUNET_assert (NULL != gst); | ||
457 | } | 482 | } |
458 | } | 483 | } |
459 | } | 484 | } |
@@ -527,10 +552,10 @@ schedule_reconnect (void *cls) | |||
527 | 552 | ||
528 | GNUNET_SOCIAL_app_disconnect (app, NULL, NULL); | 553 | GNUNET_SOCIAL_app_disconnect (app, NULL, NULL); |
529 | app = GNUNET_SOCIAL_app_connect (cfg, app_id, | 554 | app = GNUNET_SOCIAL_app_connect (cfg, app_id, |
530 | app_recv_ego, | 555 | &app_recv_ego, |
531 | app_recv_host, | 556 | &app_recv_host, |
532 | app_recv_guest, | 557 | &app_recv_guest, |
533 | app_connected, | 558 | &app_connected, |
534 | NULL); | 559 | NULL); |
535 | } | 560 | } |
536 | 561 | ||
@@ -1387,9 +1412,11 @@ run (void *cls, | |||
1387 | #endif | 1412 | #endif |
1388 | { | 1413 | { |
1389 | cfg = c; | 1414 | cfg = c; |
1415 | res = 1; | ||
1390 | end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 1416 | end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
1391 | &end_badly, NULL); | 1417 | &end_badly, NULL); |
1392 | 1418 | GNUNET_SCHEDULER_add_shutdown (&end_shutdown, | |
1419 | NULL); | ||
1393 | GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer); | 1420 | GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer); |
1394 | 1421 | ||
1395 | id = GNUNET_IDENTITY_connect (cfg, &identity_ego_cb, NULL); | 1422 | id = GNUNET_IDENTITY_connect (cfg, &identity_ego_cb, NULL); |
diff --git a/src/social/test_social.conf b/src/social/test_social.conf index 52ed20c6b..a11144b60 100644 --- a/src/social/test_social.conf +++ b/src/social/test_social.conf | |||
@@ -3,3 +3,6 @@ | |||
3 | [social] | 3 | [social] |
4 | AUTOSTART = YES | 4 | AUTOSTART = YES |
5 | FORCESTART = YES | 5 | FORCESTART = YES |
6 | |||
7 | [transport] | ||
8 | PLUGINS = udp | ||
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index 0cb136b99..87e966a01 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c | |||
@@ -998,7 +998,9 @@ client_disconnect_cb (void *cls, | |||
998 | * | 998 | * |
999 | * @param cls NULL | 999 | * @param cls NULL |
1000 | * @param message the message found on disk | 1000 | * @param message the message found on disk |
1001 | * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing | 1001 | * @return #GNUNET_OK on success, |
1002 | * #GNUNET_NO to stop further processing (no error) | ||
1003 | * #GNUNET_SYSERR to stop further processing with error | ||
1002 | */ | 1004 | */ |
1003 | static int | 1005 | static int |
1004 | inject_message (void *cls, | 1006 | inject_message (void *cls, |
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 392f257dd..9601e7567 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c | |||
@@ -292,8 +292,9 @@ child_death_task (void *cls) | |||
292 | * | 292 | * |
293 | * @param cls identification of the client | 293 | * @param cls identification of the client |
294 | * @param message the actual message | 294 | * @param message the actual message |
295 | * | 295 | * @return #GNUNET_OK on success, |
296 | * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing | 296 | * #GNUNET_NO to stop further processing (no error) |
297 | * #GNUNET_SYSERR to stop further processing with error | ||
297 | */ | 298 | */ |
298 | static int | 299 | static int |
299 | tokenizer_cb (void *cls, | 300 | tokenizer_cb (void *cls, |
@@ -359,7 +360,7 @@ tokenizer_cb (void *cls, | |||
359 | cfg = GNUNET_CONFIGURATION_create (); | 360 | cfg = GNUNET_CONFIGURATION_create (); |
360 | if (GNUNET_OK != | 361 | if (GNUNET_OK != |
361 | GNUNET_CONFIGURATION_deserialize (cfg, | 362 | GNUNET_CONFIGURATION_deserialize (cfg, |
362 | config, | 363 | config, |
363 | ul_config_size, | 364 | ul_config_size, |
364 | NULL)) | 365 | NULL)) |
365 | { | 366 | { |
diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c index 63ed9c4b7..f02d8bdd7 100644 --- a/src/transport/gnunet-helper-transport-wlan-dummy.c +++ b/src/transport/gnunet-helper-transport-wlan-dummy.c | |||
@@ -121,6 +121,9 @@ send_mac_to_plugin (char *buffer, struct GNUNET_TRANSPORT_WLAN_MacAddress *mac) | |||
121 | * | 121 | * |
122 | * @param cls the 'struct SendBuffer' to copy the converted message to | 122 | * @param cls the 'struct SendBuffer' to copy the converted message to |
123 | * @param hdr inbound message from the FIFO | 123 | * @param hdr inbound message from the FIFO |
124 | * @return #GNUNET_OK on success, | ||
125 | * #GNUNET_NO to stop further processing (no error) | ||
126 | * #GNUNET_SYSERR to stop further processing with error | ||
124 | */ | 127 | */ |
125 | static int | 128 | static int |
126 | stdin_send (void *cls, | 129 | stdin_send (void *cls, |
@@ -167,6 +170,9 @@ stdin_send (void *cls, | |||
167 | * | 170 | * |
168 | * @param cls the 'struct SendBuffer' to copy to | 171 | * @param cls the 'struct SendBuffer' to copy to |
169 | * @param hdr the message we received to copy to the buffer | 172 | * @param hdr the message we received to copy to the buffer |
173 | * @return #GNUNET_OK on success, | ||
174 | * #GNUNET_NO to stop further processing (no error) | ||
175 | * #GNUNET_SYSERR to stop further processing with error | ||
170 | */ | 176 | */ |
171 | static int | 177 | static int |
172 | file_in_send (void *cls, | 178 | file_in_send (void *cls, |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index d9fade44f..6a9c1b0ba 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -1651,7 +1651,7 @@ server_send_callback (void *cls, | |||
1651 | * | 1651 | * |
1652 | * @param cls current session as closure | 1652 | * @param cls current session as closure |
1653 | * @param message the message to be forwarded to transport service | 1653 | * @param message the message to be forwarded to transport service |
1654 | * @return #GNUNET_OK | 1654 | * @return #GNUNET_OK (all OK) |
1655 | */ | 1655 | */ |
1656 | static int | 1656 | static int |
1657 | server_receive_mst_cb (void *cls, | 1657 | server_receive_mst_cb (void *cls, |
diff --git a/src/transport/tcp_server_legacy.c b/src/transport/tcp_server_legacy.c index 6b4daa525..d0ce790fc 100644 --- a/src/transport/tcp_server_legacy.c +++ b/src/transport/tcp_server_legacy.c | |||
@@ -1477,23 +1477,6 @@ GNUNET_SERVER_connect_notify_cancel (struct GNUNET_SERVER_Handle *server, | |||
1477 | 1477 | ||
1478 | 1478 | ||
1479 | /** | 1479 | /** |
1480 | * Destroy the connection that is passed in via @a cls. Used | ||
1481 | * as calling #GNUNET_CONNECTION_destroy from within a function | ||
1482 | * that was itself called from within process_notify() of | ||
1483 | * 'connection.c' is not allowed (see #2329). | ||
1484 | * | ||
1485 | * @param cls connection to destroy | ||
1486 | */ | ||
1487 | static void | ||
1488 | destroy_connection (void *cls) | ||
1489 | { | ||
1490 | struct GNUNET_CONNECTION_Handle *connection = cls; | ||
1491 | |||
1492 | GNUNET_CONNECTION_destroy (connection); | ||
1493 | } | ||
1494 | |||
1495 | |||
1496 | /** | ||
1497 | * Ask the server to disconnect from the given client. | 1480 | * Ask the server to disconnect from the given client. |
1498 | * This is the same as returning #GNUNET_SYSERR from a message | 1481 | * This is the same as returning #GNUNET_SYSERR from a message |
1499 | * handler, except that it allows dropping of a client even | 1482 | * handler, except that it allows dropping of a client even |
@@ -1565,8 +1548,7 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client) | |||
1565 | GNUNET_CONNECTION_persist_ (client->connection); | 1548 | GNUNET_CONNECTION_persist_ (client->connection); |
1566 | if (NULL != client->th.cth) | 1549 | if (NULL != client->th.cth) |
1567 | GNUNET_SERVER_notify_transmit_ready_cancel (&client->th); | 1550 | GNUNET_SERVER_notify_transmit_ready_cancel (&client->th); |
1568 | (void) GNUNET_SCHEDULER_add_now (&destroy_connection, | 1551 | GNUNET_CONNECTION_destroy (client->connection); |
1569 | client->connection); | ||
1570 | /* need to cancel again, as it might have been re-added | 1552 | /* need to cancel again, as it might have been re-added |
1571 | in the meantime (i.e. during callbacks) */ | 1553 | in the meantime (i.e. during callbacks) */ |
1572 | if (NULL != client->warn_task) | 1554 | if (NULL != client->warn_task) |
diff --git a/src/util/client.c b/src/util/client.c index cf75dffbc..a5eae2a75 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -308,7 +308,9 @@ transmit_ready (void *cls) | |||
308 | * | 308 | * |
309 | * @param cls the `struct ClientState` | 309 | * @param cls the `struct ClientState` |
310 | * @param msg message we received. | 310 | * @param msg message we received. |
311 | * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing | 311 | * @return #GNUNET_OK on success, |
312 | * #GNUNET_NO to stop further processing due to disconnect (no error) | ||
313 | * #GNUNET_SYSERR to stop further processing due to error | ||
312 | */ | 314 | */ |
313 | static int | 315 | static int |
314 | recv_message (void *cls, | 316 | recv_message (void *cls, |
@@ -317,7 +319,7 @@ recv_message (void *cls, | |||
317 | struct ClientState *cstate = cls; | 319 | struct ClientState *cstate = cls; |
318 | 320 | ||
319 | if (GNUNET_YES == cstate->in_destroy) | 321 | if (GNUNET_YES == cstate->in_destroy) |
320 | return GNUNET_SYSERR; | 322 | return GNUNET_NO; |
321 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 323 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
322 | "Received message of type %u and size %u from %s\n", | 324 | "Received message of type %u and size %u from %s\n", |
323 | ntohs (msg->type), | 325 | ntohs (msg->type), |
@@ -326,7 +328,7 @@ recv_message (void *cls, | |||
326 | GNUNET_MQ_inject_message (cstate->mq, | 328 | GNUNET_MQ_inject_message (cstate->mq, |
327 | msg); | 329 | msg); |
328 | if (GNUNET_YES == cstate->in_destroy) | 330 | if (GNUNET_YES == cstate->in_destroy) |
329 | return GNUNET_SYSERR; | 331 | return GNUNET_NO; |
330 | return GNUNET_OK; | 332 | return GNUNET_OK; |
331 | } | 333 | } |
332 | 334 | ||
diff --git a/src/util/mq.c b/src/util/mq.c index c7ed5330e..6ad6b82eb 100644 --- a/src/util/mq.c +++ b/src/util/mq.c | |||
@@ -221,8 +221,10 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, | |||
221 | uint16_t mtype = ntohs (mh->type); | 221 | uint16_t mtype = ntohs (mh->type); |
222 | 222 | ||
223 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 223 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
224 | "Received message of type %u and size %u\n", | 224 | "Queue %p received message of type %u and size %u\n", |
225 | mtype, msize); | 225 | mq, |
226 | mtype, | ||
227 | msize); | ||
226 | 228 | ||
227 | if (NULL == mq->handlers) | 229 | if (NULL == mq->handlers) |
228 | goto done; | 230 | goto done; |
@@ -359,7 +361,8 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, | |||
359 | mq->current_envelope = ev; | 361 | mq->current_envelope = ev; |
360 | 362 | ||
361 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 363 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
362 | "mq: sending message of type %u, queue empty\n", ntohs(ev->mh->type)); | 364 | "mq: sending message of type %u, queue empty\n", |
365 | ntohs(ev->mh->type)); | ||
363 | 366 | ||
364 | mq->send_impl (mq, | 367 | mq->send_impl (mq, |
365 | ev->mh, | 368 | ev->mh, |
@@ -848,6 +851,9 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) | |||
848 | ev); | 851 | ev); |
849 | GNUNET_assert (0 < mq->queue_length); | 852 | GNUNET_assert (0 < mq->queue_length); |
850 | mq->queue_length--; | 853 | mq->queue_length--; |
854 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
855 | "MQ destroy drops message of type %u\n", | ||
856 | ntohs (ev->mh->type)); | ||
851 | GNUNET_MQ_discard (ev); | 857 | GNUNET_MQ_discard (ev); |
852 | } | 858 | } |
853 | if (NULL != mq->current_envelope) | 859 | if (NULL != mq->current_envelope) |
@@ -855,6 +861,9 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) | |||
855 | /* we can only discard envelopes that | 861 | /* we can only discard envelopes that |
856 | * are not queued! */ | 862 | * are not queued! */ |
857 | mq->current_envelope->parent_queue = NULL; | 863 | mq->current_envelope->parent_queue = NULL; |
864 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
865 | "MQ destroy drops message of type %u\n", | ||
866 | ntohs (mq->current_envelope->mh->type)); | ||
858 | GNUNET_MQ_discard (mq->current_envelope); | 867 | GNUNET_MQ_discard (mq->current_envelope); |
859 | mq->current_envelope = NULL; | 868 | mq->current_envelope = NULL; |
860 | GNUNET_assert (0 < mq->queue_length); | 869 | GNUNET_assert (0 < mq->queue_length); |
diff --git a/src/util/mst.c b/src/util/mst.c index 0d90c5d10..5e472965f 100644 --- a/src/util/mst.c +++ b/src/util/mst.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010, 2016 GNUnet e.V. | 3 | Copyright (C) 2010, 2016, 2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -126,6 +126,7 @@ GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, | |||
126 | int need_align; | 126 | int need_align; |
127 | unsigned long offset; | 127 | unsigned long offset; |
128 | int ret; | 128 | int ret; |
129 | int cbret; | ||
129 | 130 | ||
130 | GNUNET_assert (mst->off <= mst->pos); | 131 | GNUNET_assert (mst->off <= mst->pos); |
131 | GNUNET_assert (mst->pos <= mst->curr_buf); | 132 | GNUNET_assert (mst->pos <= mst->curr_buf); |
@@ -229,9 +230,17 @@ do_align: | |||
229 | if (one_shot == GNUNET_YES) | 230 | if (one_shot == GNUNET_YES) |
230 | one_shot = GNUNET_SYSERR; | 231 | one_shot = GNUNET_SYSERR; |
231 | mst->off += want; | 232 | mst->off += want; |
232 | if (GNUNET_SYSERR == mst->cb (mst->cb_cls, | 233 | if (GNUNET_OK != |
233 | hdr)) | 234 | (cbret = mst->cb (mst->cb_cls, |
235 | hdr))) | ||
236 | { | ||
237 | if (GNUNET_SYSERR == cbret) | ||
238 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
239 | "Failure processing message of type %u and size %u\n", | ||
240 | ntohs (hdr->type), | ||
241 | ntohs (hdr->size)); | ||
234 | return GNUNET_SYSERR; | 242 | return GNUNET_SYSERR; |
243 | } | ||
235 | if (mst->off == mst->pos) | 244 | if (mst->off == mst->pos) |
236 | { | 245 | { |
237 | /* reset to beginning of buffer, it's free right now! */ | 246 | /* reset to beginning of buffer, it's free right now! */ |
@@ -271,9 +280,17 @@ do_align: | |||
271 | } | 280 | } |
272 | if (one_shot == GNUNET_YES) | 281 | if (one_shot == GNUNET_YES) |
273 | one_shot = GNUNET_SYSERR; | 282 | one_shot = GNUNET_SYSERR; |
274 | if (GNUNET_SYSERR == mst->cb (mst->cb_cls, | 283 | if (GNUNET_OK != |
275 | hdr)) | 284 | (cbret = mst->cb (mst->cb_cls, |
285 | hdr))) | ||
286 | { | ||
287 | if (GNUNET_SYSERR == cbret) | ||
288 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
289 | "Failure processing message of type %u and size %u\n", | ||
290 | ntohs (hdr->type), | ||
291 | ntohs (hdr->size)); | ||
276 | return GNUNET_SYSERR; | 292 | return GNUNET_SYSERR; |
293 | } | ||
277 | buf += want; | 294 | buf += want; |
278 | size -= want; | 295 | size -= want; |
279 | } | 296 | } |
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index a7b1d8e2a..b07c51811 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -73,7 +73,7 @@ | |||
73 | * Argument to be passed from the driver to | 73 | * Argument to be passed from the driver to |
74 | * #GNUNET_SCHEDULER_run_from_driver(). Contains the | 74 | * #GNUNET_SCHEDULER_run_from_driver(). Contains the |
75 | * scheduler's internal state. | 75 | * scheduler's internal state. |
76 | */ | 76 | */ |
77 | struct GNUNET_SCHEDULER_Handle | 77 | struct GNUNET_SCHEDULER_Handle |
78 | { | 78 | { |
79 | /** | 79 | /** |
@@ -94,7 +94,7 @@ struct GNUNET_SCHEDULER_Handle | |||
94 | * Driver we used for the event loop. | 94 | * Driver we used for the event loop. |
95 | */ | 95 | */ |
96 | const struct GNUNET_SCHEDULER_Driver *driver; | 96 | const struct GNUNET_SCHEDULER_Driver *driver; |
97 | 97 | ||
98 | }; | 98 | }; |
99 | 99 | ||
100 | 100 | ||
@@ -127,7 +127,7 @@ struct GNUNET_SCHEDULER_Task | |||
127 | * Handle to the scheduler's state. | 127 | * Handle to the scheduler's state. |
128 | */ | 128 | */ |
129 | const struct GNUNET_SCHEDULER_Handle *sh; | 129 | const struct GNUNET_SCHEDULER_Handle *sh; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * Set of file descriptors this task is waiting | 132 | * Set of file descriptors this task is waiting |
133 | * for for reading. Once ready, this is updated | 133 | * for for reading. Once ready, this is updated |
@@ -172,7 +172,7 @@ struct GNUNET_SCHEDULER_Task | |||
172 | * Size of the @e fds array. | 172 | * Size of the @e fds array. |
173 | */ | 173 | */ |
174 | unsigned int fds_len; | 174 | unsigned int fds_len; |
175 | 175 | ||
176 | /** | 176 | /** |
177 | * Why is the task ready? Set after task is added to ready queue. | 177 | * Why is the task ready? Set after task is added to ready queue. |
178 | * Initially set to zero. All reasons that have already been | 178 | * Initially set to zero. All reasons that have already been |
@@ -589,9 +589,7 @@ static void | |||
589 | dump_backtrace (struct GNUNET_SCHEDULER_Task *t) | 589 | dump_backtrace (struct GNUNET_SCHEDULER_Task *t) |
590 | { | 590 | { |
591 | #if EXECINFO | 591 | #if EXECINFO |
592 | unsigned int i; | 592 | for (unsigned int i = 0; i < t->num_backtrace_strings; i++) |
593 | |||
594 | for (i = 0; i < t->num_backtrace_strings; i++) | ||
595 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 593 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
596 | "Task %p trace %u: %s\n", | 594 | "Task %p trace %u: %s\n", |
597 | t, | 595 | t, |
@@ -1849,7 +1847,7 @@ GNUNET_SCHEDULER_task_ready (struct GNUNET_SCHEDULER_Task *task, | |||
1849 | * | 1847 | * |
1850 | * @param sh scheduler handle that was given to the `loop` | 1848 | * @param sh scheduler handle that was given to the `loop` |
1851 | * @return #GNUNET_OK if there are more tasks that are ready, | 1849 | * @return #GNUNET_OK if there are more tasks that are ready, |
1852 | * and thus we would like to run more (yield to avoid | 1850 | * and thus we would like to run more (yield to avoid |
1853 | * blocking other activities for too long) | 1851 | * blocking other activities for too long) |
1854 | * #GNUNET_NO if we are done running tasks (yield to block) | 1852 | * #GNUNET_NO if we are done running tasks (yield to block) |
1855 | * #GNUNET_SYSERR on error | 1853 | * #GNUNET_SYSERR on error |
@@ -1876,11 +1874,11 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh) | |||
1876 | pending_timeout_last = NULL; | 1874 | pending_timeout_last = NULL; |
1877 | queue_ready_task (pos); | 1875 | queue_ready_task (pos); |
1878 | } | 1876 | } |
1879 | 1877 | ||
1880 | if (0 == ready_count) | 1878 | if (0 == ready_count) |
1881 | return GNUNET_NO; | 1879 | return GNUNET_NO; |
1882 | 1880 | ||
1883 | /* find out which task priority level we are going to | 1881 | /* find out which task priority level we are going to |
1884 | process this time */ | 1882 | process this time */ |
1885 | max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP; | 1883 | max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP; |
1886 | GNUNET_assert (NULL == ready_head[GNUNET_SCHEDULER_PRIORITY_KEEP]); | 1884 | GNUNET_assert (NULL == ready_head[GNUNET_SCHEDULER_PRIORITY_KEEP]); |
diff --git a/src/util/service.c b/src/util/service.c index 10dc93faf..782adf5c5 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -2402,7 +2402,7 @@ resume_client_receive (void *cls) | |||
2402 | GNUNET_YES); | 2402 | GNUNET_YES); |
2403 | if (GNUNET_SYSERR == ret) | 2403 | if (GNUNET_SYSERR == ret) |
2404 | { | 2404 | { |
2405 | if (NULL != c->drop_task) | 2405 | if (NULL == c->drop_task) |
2406 | GNUNET_SERVICE_client_drop (c); | 2406 | GNUNET_SERVICE_client_drop (c); |
2407 | return; | 2407 | return; |
2408 | } | 2408 | } |
@@ -2514,6 +2514,10 @@ GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c) | |||
2514 | { | 2514 | { |
2515 | struct GNUNET_SERVICE_Handle *sh = c->sh; | 2515 | struct GNUNET_SERVICE_Handle *sh = c->sh; |
2516 | 2516 | ||
2517 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2518 | "Client dropped: %p (MQ: %p)\n", | ||
2519 | c, | ||
2520 | c->mq); | ||
2517 | if (NULL != c->drop_task) | 2521 | if (NULL != c->drop_task) |
2518 | { | 2522 | { |
2519 | /* asked to drop twice! */ | 2523 | /* asked to drop twice! */ |
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index d9daaa7e2..bdc638176 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -2218,6 +2218,9 @@ route_packet (struct DestinationEntry *destination, | |||
2218 | * | 2218 | * |
2219 | * @param cls closure, NULL | 2219 | * @param cls closure, NULL |
2220 | * @param message message we got from the client (VPN channel interface) | 2220 | * @param message message we got from the client (VPN channel interface) |
2221 | * @return #GNUNET_OK on success, | ||
2222 | * #GNUNET_NO to stop further processing (no error) | ||
2223 | * #GNUNET_SYSERR to stop further processing with error | ||
2221 | */ | 2224 | */ |
2222 | static int | 2225 | static int |
2223 | message_token (void *cls, | 2226 | message_token (void *cls, |