diff options
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index e815ee200..23192b86b 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -913,6 +913,7 @@ decrease_max_send_delay (struct GNUNET_TIME_Relative max_time) | |||
913 | } | 913 | } |
914 | } | 914 | } |
915 | 915 | ||
916 | |||
916 | /** | 917 | /** |
917 | * Find the maximum send time of the recently sent values. | 918 | * Find the maximum send time of the recently sent values. |
918 | * | 919 | * |
@@ -940,24 +941,25 @@ get_max_send_delay () | |||
940 | return max_time; | 941 | return max_time; |
941 | } | 942 | } |
942 | 943 | ||
944 | |||
943 | static void | 945 | static void |
944 | increment_stats (const char *value) | 946 | increment_stats (const char *value) |
945 | { | 947 | { |
946 | if (stats != NULL) | 948 | if (stats == NULL) |
947 | { | 949 | return; |
948 | GNUNET_STATISTICS_update (stats, value, 1, GNUNET_NO); | 950 | GNUNET_STATISTICS_update (stats, value, 1, GNUNET_NO); |
949 | } | ||
950 | } | 951 | } |
951 | 952 | ||
953 | |||
952 | static void | 954 | static void |
953 | decrement_stats (const char *value) | 955 | decrement_stats (const char *value) |
954 | { | 956 | { |
955 | if (stats != NULL) | 957 | if (stats == NULL) |
956 | { | 958 | return; |
957 | GNUNET_STATISTICS_update (stats, value, -1, GNUNET_NO); | 959 | GNUNET_STATISTICS_update (stats, value, -1, GNUNET_NO); |
958 | } | ||
959 | } | 960 | } |
960 | 961 | ||
962 | |||
961 | /** | 963 | /** |
962 | * Try to send another message from our core send list | 964 | * Try to send another message from our core send list |
963 | */ | 965 | */ |
@@ -999,6 +1001,7 @@ try_core_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
999 | } | 1001 | } |
1000 | } | 1002 | } |
1001 | 1003 | ||
1004 | |||
1002 | /** | 1005 | /** |
1003 | * Function called to send a request out to another peer. | 1006 | * Function called to send a request out to another peer. |
1004 | * Called both for locally initiated requests and those | 1007 | * Called both for locally initiated requests and those |
@@ -1218,6 +1221,7 @@ distance (const GNUNET_HashCode * target, const GNUNET_HashCode * have) | |||
1218 | return msb | lsb; | 1221 | return msb | lsb; |
1219 | } | 1222 | } |
1220 | 1223 | ||
1224 | |||
1221 | /** | 1225 | /** |
1222 | * Return a number that is larger the closer the | 1226 | * Return a number that is larger the closer the |
1223 | * "have" GNUNET_hash code is to the "target". | 1227 | * "have" GNUNET_hash code is to the "target". |
@@ -2338,6 +2342,7 @@ handle_dht_get (const struct GNUNET_MessageHeader *msg, | |||
2338 | return results; | 2342 | return results; |
2339 | } | 2343 | } |
2340 | 2344 | ||
2345 | |||
2341 | static void | 2346 | static void |
2342 | remove_recent_find_peer (void *cls, | 2347 | remove_recent_find_peer (void *cls, |
2343 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 2348 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -2350,6 +2355,7 @@ remove_recent_find_peer (void *cls, | |||
2350 | GNUNET_free (key); | 2355 | GNUNET_free (key); |
2351 | } | 2356 | } |
2352 | 2357 | ||
2358 | |||
2353 | /** | 2359 | /** |
2354 | * Server handler for initiating local dht find peer requests | 2360 | * Server handler for initiating local dht find peer requests |
2355 | * | 2361 | * |