[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31340 - gnunet/src/hostlist
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31340 - gnunet/src/hostlist |
Date: |
Thu, 12 Dec 2013 22:31:39 +0100 |
Author: grothoff
Date: 2013-12-12 22:31:39 +0100 (Thu, 12 Dec 2013)
New Revision: 31340
Modified:
gnunet/src/hostlist/gnunet-daemon-hostlist.c
gnunet/src/hostlist/hostlist-client.c
Log:
-doxygen, style, possibly fixing hostlist-client missing first core connect
notification
Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c 2013-12-12 21:11:17 UTC
(rev 31339)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c 2013-12-12 21:31:39 UTC
(rev 31340)
@@ -28,13 +28,9 @@
#include "platform.h"
#include "hostlist-client.h"
#include "gnunet_core_service.h"
-#include "gnunet_getopt_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
-#include "gnunet_program_lib.h"
#include "gnunet_statistics_service.h"
-#include "gnunet_strings_lib.h"
-#include "gnunet_time_lib.h"
-#include "gnunet_util_lib.h"
#if HAVE_MHD
@@ -156,7 +152,8 @@
/**
- * Method called whenever a given peer connects. Wrapper to call both
client's and server's functions
+ * Method called whenever a given peer connects. Wrapper to call both
+ * client's and server's functions
*
* @param cls closure
* @param peer peer identity this notification is about
@@ -169,17 +166,17 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"A new peer connected, notifying client and server\n");
if (NULL != client_ch)
- {
(*client_ch) (cls, peer);
- }
#if HAVE_MHD
if (NULL != server_ch)
(*server_ch) (cls, peer);
#endif
}
+
/**
- * Method called whenever a given peer disconnects. Wrapper to call both
client's and server's functions
+ * Method called whenever a given peer disconnects. Wrapper to call
+ * both client's and server's functions
*
* @param cls closure
* @param peer peer identity this notification is about
@@ -199,6 +196,7 @@
#endif
}
+
/**
* Last task run during shutdown. Disconnects us from
* the other services.
@@ -206,7 +204,8 @@
static void
cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist daemon is shutting down\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Hostlist daemon is shutting down\n");
if (core != NULL)
{
GNUNET_CORE_disconnect (core);
@@ -260,31 +259,27 @@
("None of the functions for the hostlist daemon were enabled.
I have no reason to run!\n"));
return;
}
-
-
-
stats = GNUNET_STATISTICS_create ("hostlist", cfg);
-
- core =
- GNUNET_CORE_connect (cfg, NULL, &core_init, &connect_handler,
- &disconnect_handler, NULL, GNUNET_NO, NULL,
- GNUNET_NO,
- learning ? learn_handlers : no_learn_handlers);
-
if (bootstrapping)
- {
GNUNET_HOSTLIST_client_start (cfg, stats, &client_ch, &client_dh,
&client_adv_handler, learning);
- }
+ core =
+ GNUNET_CORE_connect (cfg, NULL,
+ &core_init,
+ &connect_handler,
+ &disconnect_handler, NULL,
+ GNUNET_NO, NULL,
+ GNUNET_NO,
+ learning ? learn_handlers : no_learn_handlers);
+
#if HAVE_MHD
if (provide_hostlist)
- {
GNUNET_HOSTLIST_server_start (cfg, stats, core, &server_ch, &server_dh,
advertising);
- }
#endif
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleaning_task,
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &cleaning_task,
NULL);
if (NULL == core)
Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c 2013-12-12 21:11:17 UTC (rev
31339)
+++ gnunet/src/hostlist/hostlist-client.c 2013-12-12 21:31:39 UTC (rev
31340)
@@ -33,8 +33,7 @@
#include "gnunet_transport_service.h"
#include "gnunet-daemon-hostlist.h"
#include <curl/curl.h>
-#include "gnunet_common.h"
-#include "gnunet_bio_lib.h"
+#include "gnunet_util_lib.h"
/**
@@ -416,6 +415,7 @@
return ret;
}
+
/**
* Method deciding if a preconfigured or advertisied hostlist is used on a
50:50 ratio
* @return uri to use, NULL if there is no URL available
@@ -479,6 +479,7 @@
/**
* add val2 to val1 with overflow check
+ *
* @param val1 value 1
* @param val2 value 2
* @return result
@@ -501,6 +502,7 @@
/**
* Subtract val2 from val1 with underflow check
+ *
* @param val1 value 1
* @param val2 value 2
* @return result
@@ -516,8 +518,9 @@
/**
* Method to check if a URI is in hostlist linked list
+ *
* @param uri uri to check
- * @return GNUNET_YES if existing in linked list, GNUNET_NO if not
+ * @return #GNUNET_YES if existing in linked list, #GNUNET_NO if not
*/
static int
linked_list_contains (const char *uri)
@@ -1130,8 +1133,8 @@
* @param cls closure (always NULL)
* @param peer the peer sending the message
* @param message the actual message
- * @return GNUNET_OK to keep the connection open,
- * GNUNET_SYSERR to close it (signal serious error)
+ * @return #GNUNET_OK to keep the connection open,
+ * #GNUNET_SYSERR to close it (signal serious error)
*/
static int
handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer,
@@ -1211,8 +1214,8 @@
* we go the stat. Initiates hostlist download scheduling.
*
* @param cls closure
- * @param success GNUNET_OK if statistics were
- * successfully obtained, GNUNET_SYSERR if not.
+ * @param success #GNUNET_OK if statistics were
+ * successfully obtained, #GNUNET_SYSERR if not.
*/
static void
primary_task (void *cls, int success)
@@ -1256,8 +1259,6 @@
char *uri;
char *emsg;
struct Hostlist *hostlist;
-
- uri = NULL;
uint32_t times_used;
uint32_t hellos_returned;
uint64_t quality;
@@ -1265,6 +1266,7 @@
uint64_t created;
uint32_t counter;
+ uri = NULL;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg, "HOSTLIST", "HOSTLISTFILE",
&filename))
@@ -1275,7 +1277,8 @@
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Loading saved hostlist entries from file `%s' \n"), filename);
+ _("Loading saved hostlist entries from file `%s' \n"),
+ filename);
if (GNUNET_NO == GNUNET_DISK_file_test (filename))
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31340 - gnunet/src/hostlist,
gnunet <=