diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-18 16:22:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-18 16:22:14 +0000 |
commit | fb12af8319a84389a536ab2f3735daf3b24f11bd (patch) | |
tree | 53e1424149fe8e7d5673e783868fcaa8a6bdbb55 /src/peerstore/peerstore_api.c | |
parent | d19064a18f3fcf35c94d7f56485e41fb3425d066 (diff) | |
download | gnunet-fb12af8319a84389a536ab2f3735daf3b24f11bd.tar.gz gnunet-fb12af8319a84389a536ab2f3735daf3b24f11bd.zip |
-use const in peerstore callback
Diffstat (limited to 'src/peerstore/peerstore_api.c')
-rw-r--r-- | src/peerstore/peerstore_api.c | 58 |
1 files changed, 20 insertions, 38 deletions
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c index 90594f73a..46f170a23 100644 --- a/src/peerstore/peerstore_api.c +++ b/src/peerstore/peerstore_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) | 3 | (C) 2013-2014 Christian Grothoff (and other contributing authors) |
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 |
@@ -17,11 +17,11 @@ | |||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | |||
21 | /** | 20 | /** |
22 | * @file peerstore/peerstore_api.c | 21 | * @file peerstore/peerstore_api.c |
23 | * @brief API for peerstore | 22 | * @brief API for peerstore |
24 | * @author Omar Tarabai | 23 | * @author Omar Tarabai |
24 | * @author Christian Grothoff | ||
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
@@ -292,15 +292,30 @@ reconnect (struct GNUNET_PEERSTORE_Handle *h); | |||
292 | * @param cls a 'struct GNUNET_PEERSTORE_WatchContext *' | 292 | * @param cls a 'struct GNUNET_PEERSTORE_WatchContext *' |
293 | */ | 293 | */ |
294 | static void | 294 | static void |
295 | watch_request_sent (void *cls); | 295 | watch_request_sent (void *cls) |
296 | { | ||
297 | struct GNUNET_PEERSTORE_WatchContext *wc = cls; | ||
298 | |||
299 | wc->request_sent = GNUNET_YES; | ||
300 | wc->ev = NULL; | ||
301 | } | ||
302 | |||
296 | 303 | ||
297 | /** | 304 | /** |
298 | * Callback after MQ envelope is sent | 305 | * Callback after MQ envelope is sent |
299 | * | 306 | * |
300 | * @param cls a 'struct GNUNET_PEERSTORE_IterateContext *' | 307 | * @param cls a `struct GNUNET_PEERSTORE_IterateContext *` |
301 | */ | 308 | */ |
302 | static void | 309 | static void |
303 | iterate_request_sent (void *cls); | 310 | iterate_request_sent (void *cls) |
311 | { | ||
312 | struct GNUNET_PEERSTORE_IterateContext *ic = cls; | ||
313 | |||
314 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
315 | "Iterate request sent to service.\n"); | ||
316 | ic->iterating = GNUNET_YES; | ||
317 | ic->ev = NULL; | ||
318 | } | ||
304 | 319 | ||
305 | 320 | ||
306 | /** | 321 | /** |
@@ -724,7 +739,6 @@ handle_iterate_result (void *cls, | |||
724 | callback_cls = ic->callback_cls; | 739 | callback_cls = ic->callback_cls; |
725 | if (NULL == msg) /* Connection error */ | 740 | if (NULL == msg) /* Connection error */ |
726 | { | 741 | { |
727 | |||
728 | if (NULL != callback) | 742 | if (NULL != callback) |
729 | callback (callback_cls, NULL, | 743 | callback (callback_cls, NULL, |
730 | _("Error communicating with `PEERSTORE' service.")); | 744 | _("Error communicating with `PEERSTORE' service.")); |
@@ -759,23 +773,6 @@ handle_iterate_result (void *cls, | |||
759 | 773 | ||
760 | 774 | ||
761 | /** | 775 | /** |
762 | * Callback after MQ envelope is sent | ||
763 | * | ||
764 | * @param cls a `struct GNUNET_PEERSTORE_IterateContext *` | ||
765 | */ | ||
766 | static void | ||
767 | iterate_request_sent (void *cls) | ||
768 | { | ||
769 | struct GNUNET_PEERSTORE_IterateContext *ic = cls; | ||
770 | |||
771 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
772 | "Iterate request sent to service.\n"); | ||
773 | ic->iterating = GNUNET_YES; | ||
774 | ic->ev = NULL; | ||
775 | } | ||
776 | |||
777 | |||
778 | /** | ||
779 | * Called when the iterate request is timedout | 776 | * Called when the iterate request is timedout |
780 | * | 777 | * |
781 | * @param cls a `struct GNUNET_PEERSTORE_IterateContext *` | 778 | * @param cls a `struct GNUNET_PEERSTORE_IterateContext *` |
@@ -923,21 +920,6 @@ handle_watch_result (void *cls, const struct GNUNET_MessageHeader *msg) | |||
923 | 920 | ||
924 | 921 | ||
925 | /** | 922 | /** |
926 | * Callback after MQ envelope is sent | ||
927 | * | ||
928 | * @param cls a `struct GNUNET_PEERSTORE_WatchContext *` | ||
929 | */ | ||
930 | static void | ||
931 | watch_request_sent (void *cls) | ||
932 | { | ||
933 | struct GNUNET_PEERSTORE_WatchContext *wc = cls; | ||
934 | |||
935 | wc->request_sent = GNUNET_YES; | ||
936 | wc->ev = NULL; | ||
937 | } | ||
938 | |||
939 | |||
940 | /** | ||
941 | * Cancel a watch request | 923 | * Cancel a watch request |
942 | * | 924 | * |
943 | * @param wc handle to the watch request | 925 | * @param wc handle to the watch request |