aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/gnunet-service-core.c10
-rw-r--r--src/datastore/gnunet-service-datastore.c10
-rw-r--r--src/fs/gnunet-service-fs.c52
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c4
-rw-r--r--src/hostlist/hostlist-server.c15
-rw-r--r--src/statistics/gnunet-service-statistics.c10
-rw-r--r--src/transport/gnunet-nat-client.c3
-rw-r--r--src/transport/gnunet-service-transport.c17
8 files changed, 43 insertions, 78 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 34b3511a8..7fcb03094 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -669,11 +669,6 @@ static struct GNUNET_PEERINFO_Handle *peerinfo;
669const struct GNUNET_CONFIGURATION_Handle *cfg; 669const struct GNUNET_CONFIGURATION_Handle *cfg;
670 670
671/** 671/**
672 * Our server.
673 */
674static struct GNUNET_SERVER_Handle *server;
675
676/**
677 * Transport service. 672 * Transport service.
678 */ 673 */
679static struct GNUNET_TRANSPORT_Handle *transport; 674static struct GNUNET_TRANSPORT_Handle *transport;
@@ -3808,13 +3803,13 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3808 * 3803 *
3809 * @param cls closure 3804 * @param cls closure
3810 * @param s scheduler to use 3805 * @param s scheduler to use
3811 * @param serv the initialized server 3806 * @param server the initialized server
3812 * @param c configuration to use 3807 * @param c configuration to use
3813 */ 3808 */
3814static void 3809static void
3815run (void *cls, 3810run (void *cls,
3816 struct GNUNET_SCHEDULER_Handle *s, 3811 struct GNUNET_SCHEDULER_Handle *s,
3817 struct GNUNET_SERVER_Handle *serv, 3812 struct GNUNET_SERVER_Handle *server,
3818 const struct GNUNET_CONFIGURATION_Handle *c) 3813 const struct GNUNET_CONFIGURATION_Handle *c)
3819{ 3814{
3820 static const struct GNUNET_SERVER_MessageHandler handlers[] = { 3815 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
@@ -3880,7 +3875,6 @@ run (void *cls,
3880 GNUNET_CRYPTO_hash (&my_public_key, 3875 GNUNET_CRYPTO_hash (&my_public_key,
3881 sizeof (my_public_key), &my_identity.hashPubKey); 3876 sizeof (my_public_key), &my_identity.hashPubKey);
3882 /* setup notification */ 3877 /* setup notification */
3883 server = serv;
3884 notifier = GNUNET_SERVER_notification_context_create (server, 3878 notifier = GNUNET_SERVER_notification_context_create (server,
3885 MAX_NOTIFY_QUEUE); 3879 MAX_NOTIFY_QUEUE);
3886 GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); 3880 GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index ddab5cdf3..faae1ae99 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -125,11 +125,6 @@ static struct ReservationList *reservations;
125static struct GNUNET_CONTAINER_BloomFilter *filter; 125static struct GNUNET_CONTAINER_BloomFilter *filter;
126 126
127/** 127/**
128 * Static counter to produce reservation identifiers.
129 */
130static int reservation_gen;
131
132/**
133 * How much space are we allowed to use? 128 * How much space are we allowed to use?
134 */ 129 */
135static unsigned long long quota; 130static unsigned long long quota;
@@ -717,6 +712,11 @@ handle_reserve (void *cls,
717 struct GNUNET_SERVER_Client *client, 712 struct GNUNET_SERVER_Client *client,
718 const struct GNUNET_MessageHeader *message) 713 const struct GNUNET_MessageHeader *message)
719{ 714{
715 /**
716 * Static counter to produce reservation identifiers.
717 */
718 static int reservation_gen;
719
720 const struct ReserveMessage *msg = (const struct ReserveMessage*) message; 720 const struct ReserveMessage *msg = (const struct ReserveMessage*) message;
721 struct ReservationList *e; 721 struct ReservationList *e;
722 unsigned long long used; 722 unsigned long long used;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 90d0cabaf..1c542386c 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -3414,38 +3414,6 @@ handle_start_search (void *cls,
3414 3414
3415/* **************************** Startup ************************ */ 3415/* **************************** Startup ************************ */
3416 3416
3417
3418/**
3419 * List of handlers for P2P messages
3420 * that we care about.
3421 */
3422static struct GNUNET_CORE_MessageHandler p2p_handlers[] =
3423 {
3424 { &handle_p2p_get,
3425 GNUNET_MESSAGE_TYPE_FS_GET, 0 },
3426 { &handle_p2p_put,
3427 GNUNET_MESSAGE_TYPE_FS_PUT, 0 },
3428 { NULL, 0, 0 }
3429 };
3430
3431
3432/**
3433 * List of handlers for the messages understood by this
3434 * service.
3435 */
3436static struct GNUNET_SERVER_MessageHandler handlers[] = {
3437 {&GNUNET_FS_handle_index_start, NULL,
3438 GNUNET_MESSAGE_TYPE_FS_INDEX_START, 0},
3439 {&GNUNET_FS_handle_index_list_get, NULL,
3440 GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET, sizeof(struct GNUNET_MessageHeader) },
3441 {&GNUNET_FS_handle_unindex, NULL, GNUNET_MESSAGE_TYPE_FS_UNINDEX,
3442 sizeof (struct UnindexMessage) },
3443 {&handle_start_search, NULL, GNUNET_MESSAGE_TYPE_FS_START_SEARCH,
3444 0 },
3445 {NULL, NULL, 0, 0}
3446};
3447
3448
3449/** 3417/**
3450 * Process fs requests. 3418 * Process fs requests.
3451 * 3419 *
@@ -3458,6 +3426,26 @@ main_init (struct GNUNET_SCHEDULER_Handle *s,
3458 struct GNUNET_SERVER_Handle *server, 3426 struct GNUNET_SERVER_Handle *server,
3459 const struct GNUNET_CONFIGURATION_Handle *c) 3427 const struct GNUNET_CONFIGURATION_Handle *c)
3460{ 3428{
3429 static const struct GNUNET_CORE_MessageHandler p2p_handlers[] =
3430 {
3431 { &handle_p2p_get,
3432 GNUNET_MESSAGE_TYPE_FS_GET, 0 },
3433 { &handle_p2p_put,
3434 GNUNET_MESSAGE_TYPE_FS_PUT, 0 },
3435 { NULL, 0, 0 }
3436 };
3437 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
3438 {&GNUNET_FS_handle_index_start, NULL,
3439 GNUNET_MESSAGE_TYPE_FS_INDEX_START, 0},
3440 {&GNUNET_FS_handle_index_list_get, NULL,
3441 GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET, sizeof(struct GNUNET_MessageHeader) },
3442 {&GNUNET_FS_handle_unindex, NULL, GNUNET_MESSAGE_TYPE_FS_UNINDEX,
3443 sizeof (struct UnindexMessage) },
3444 {&handle_start_search, NULL, GNUNET_MESSAGE_TYPE_FS_START_SEARCH,
3445 0 },
3446 {NULL, NULL, 0, 0}
3447 };
3448
3461 sched = s; 3449 sched = s;
3462 cfg = c; 3450 cfg = c;
3463 stats = GNUNET_STATISTICS_create (sched, "fs", cfg); 3451 stats = GNUNET_STATISTICS_create (sched, "fs", cfg);
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 300a767b5..b0599312c 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -53,12 +53,12 @@ static int provide_hostlist;
53/** 53/**
54 * Handle to hostlist server's connect handler 54 * Handle to hostlist server's connect handler
55 */ 55 */
56static GNUNET_CORE_ConnectEventHandler server_ch = NULL; 56static GNUNET_CORE_ConnectEventHandler server_ch;
57 57
58/** 58/**
59 * Handle to hostlist server's disconnect handler 59 * Handle to hostlist server's disconnect handler
60 */ 60 */
61static GNUNET_CORE_DisconnectEventHandler server_dh = NULL; 61static GNUNET_CORE_DisconnectEventHandler server_dh;
62 62
63#endif 63#endif
64 64
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c
index 5d8a07ef2..0726bf3e0 100644
--- a/src/hostlist/hostlist-server.c
+++ b/src/hostlist/hostlist-server.c
@@ -110,11 +110,6 @@ struct HostSet
110static int advertising; 110static int advertising;
111 111
112/** 112/**
113 * How many times was the hostlist advertised?
114 */
115static uint64_t hostlist_adv_count;
116
117/**
118 * Buffer for the hostlist address 113 * Buffer for the hostlist address
119 */ 114 */
120static char * hostlist_uri; 115static char * hostlist_uri;
@@ -345,6 +340,8 @@ access_handler_callback (void *cls,
345static size_t 340static size_t
346adv_transmit_ready ( void *cls, size_t size, void *buf) 341adv_transmit_ready ( void *cls, size_t size, void *buf)
347{ 342{
343 static uint64_t hostlist_adv_count;
344
348 size_t transmission_size; 345 size_t transmission_size;
349 size_t uri_size; /* Including \0 termination! */ 346 size_t uri_size; /* Including \0 termination! */
350 struct GNUNET_MessageHeader header; 347 struct GNUNET_MessageHeader header;
@@ -372,10 +369,10 @@ adv_transmit_ready ( void *cls, size_t size, void *buf)
372 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 369 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
373 " # Sent advertisement message: %u\n", 370 " # Sent advertisement message: %u\n",
374 hostlist_adv_count); 371 hostlist_adv_count);
375 GNUNET_STATISTICS_set (stats, 372 GNUNET_STATISTICS_update (stats,
376 gettext_noop("# hostlist advertisements send"), 373 gettext_noop("# hostlist advertisements send"),
377 hostlist_adv_count, 374 1,
378 GNUNET_NO); 375 GNUNET_NO);
379 return transmission_size; 376 return transmission_size;
380} 377}
381 378
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index efc6ce128..c34a00ddc 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -93,11 +93,6 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
93static struct StatsEntry *start; 93static struct StatsEntry *start;
94 94
95/** 95/**
96 * Counter used to generate unique values.
97 */
98static uint32_t uidgen;
99
100/**
101 * Load persistent values from disk. Disk format is 96 * Load persistent values from disk. Disk format is
102 * exactly the same format that we also use for 97 * exactly the same format that we also use for
103 * setting the values over the network. 98 * setting the values over the network.
@@ -316,6 +311,11 @@ handle_set (void *cls,
316 struct GNUNET_SERVER_Client *client, 311 struct GNUNET_SERVER_Client *client,
317 const struct GNUNET_MessageHeader *message) 312 const struct GNUNET_MessageHeader *message)
318{ 313{
314 /**
315 * Counter used to generate unique values.
316 */
317 static uint32_t uidgen;
318
319 char *service; 319 char *service;
320 char *name; 320 char *name;
321 uint16_t msize; 321 uint16_t msize;
diff --git a/src/transport/gnunet-nat-client.c b/src/transport/gnunet-nat-client.c
index 56bbf65b5..8648a4679 100644
--- a/src/transport/gnunet-nat-client.c
+++ b/src/transport/gnunet-nat-client.c
@@ -106,8 +106,6 @@ static int rawsock;
106 106
107static struct in_addr dummy; 107static struct in_addr dummy;
108 108
109static struct in_addr target;
110
111static uint32_t port; 109static uint32_t port;
112 110
113static uint16_t 111static uint16_t
@@ -364,6 +362,7 @@ int
364main (int argc, char *const *argv) 362main (int argc, char *const *argv)
365{ 363{
366 struct in_addr external; 364 struct in_addr external;
365 struct in_addr target;
367 uid_t uid; 366 uid_t uid;
368 367
369 if (-1 == (rawsock = make_raw_socket())) 368 if (-1 == (rawsock = make_raw_socket()))
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 2d6a1cbb0..f3fc93a7a 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -805,12 +805,6 @@ struct CheckHelloValidatedContext
805static struct GNUNET_HELLO_Message *our_hello; 805static struct GNUNET_HELLO_Message *our_hello;
806 806
807/** 807/**
808 * "version" of "our_hello". Used to see if a given neighbour has
809 * already been sent the latest version of our HELLO message.
810 */
811static unsigned int our_hello_version;
812
813/**
814 * Our public key. 808 * Our public key.
815 */ 809 */
816static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded my_public_key; 810static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded my_public_key;
@@ -846,11 +840,6 @@ static struct TransportClient *clients;
846static struct TransportPlugin *plugins; 840static struct TransportPlugin *plugins;
847 841
848/** 842/**
849 * Our server.
850 */
851static struct GNUNET_SERVER_Handle *server;
852
853/**
854 * Handle to peerinfo service. 843 * Handle to peerinfo service.
855 */ 844 */
856static struct GNUNET_PEERINFO_Handle *peerinfo; 845static struct GNUNET_PEERINFO_Handle *peerinfo;
@@ -1853,7 +1842,6 @@ refresh_hello ()
1853 1842
1854 GNUNET_free_non_null (our_hello); 1843 GNUNET_free_non_null (our_hello);
1855 our_hello = hello; 1844 our_hello = hello;
1856 our_hello_version++;
1857 GNUNET_PEERINFO_add_peer (peerinfo, our_hello); 1845 GNUNET_PEERINFO_add_peer (peerinfo, our_hello);
1858 npos = neighbours; 1846 npos = neighbours;
1859 while (npos != NULL) 1847 while (npos != NULL)
@@ -4885,13 +4873,13 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
4885 * 4873 *
4886 * @param cls closure 4874 * @param cls closure
4887 * @param s scheduler to use 4875 * @param s scheduler to use
4888 * @param serv the initialized server 4876 * @param server the initialized server
4889 * @param c configuration to use 4877 * @param c configuration to use
4890 */ 4878 */
4891static void 4879static void
4892run (void *cls, 4880run (void *cls,
4893 struct GNUNET_SCHEDULER_Handle *s, 4881 struct GNUNET_SCHEDULER_Handle *s,
4894 struct GNUNET_SERVER_Handle *serv, 4882 struct GNUNET_SERVER_Handle *server,
4895 const struct GNUNET_CONFIGURATION_Handle *c) 4883 const struct GNUNET_CONFIGURATION_Handle *c)
4896{ 4884{
4897 static const struct GNUNET_SERVER_MessageHandler handlers[] = { 4885 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
@@ -4984,7 +4972,6 @@ run (void *cls,
4984 GNUNET_CRYPTO_hash (&my_public_key, 4972 GNUNET_CRYPTO_hash (&my_public_key,
4985 sizeof (my_public_key), &my_identity.hashPubKey); 4973 sizeof (my_public_key), &my_identity.hashPubKey);
4986 /* setup notification */ 4974 /* setup notification */
4987 server = serv;
4988 GNUNET_SERVER_disconnect_notify (server, 4975 GNUNET_SERVER_disconnect_notify (server,
4989 &client_disconnect_notification, NULL); 4976 &client_disconnect_notification, NULL);
4990 /* load plugins... */ 4977 /* load plugins... */