[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11633 - gnunet/src/hostlist
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11633 - gnunet/src/hostlist |
Date: |
Tue, 8 Jun 2010 10:17:06 +0200 |
Author: wachs
Date: 2010-06-08 10:17:06 +0200 (Tue, 08 Jun 2010)
New Revision: 11633
Modified:
gnunet/src/hostlist/hostlist-client.c
Log:
Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c 2010-06-08 07:56:41 UTC (rev
11632)
+++ gnunet/src/hostlist/hostlist-client.c 2010-06-08 08:17:06 UTC (rev
11633)
@@ -1063,6 +1063,9 @@
task_check (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ static int once;
+ struct GNUNET_TIME_Relative delay;
+
ti_check_download = GNUNET_SCHEDULER_NO_TASK;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1074,14 +1077,11 @@
NULL);
}
- static int once;
- struct GNUNET_TIME_Relative delay;
-
if (stats == NULL)
- {
- curl_global_cleanup ();
- return; /* in shutdown */
- }
+ {
+ curl_global_cleanup ();
+ return; /* in shutdown */
+ }
delay = hostlist_delay;
if (hostlist_delay.value == 0)
hostlist_delay = GNUNET_TIME_UNIT_SECONDS;
@@ -1168,11 +1168,17 @@
struct GNUNET_TIME_Relative latency,
uint32_t distance)
{
+ unsigned int max = 0 ;
+ max --;
+
+ if (stat_connection_count < max)
+ {
stat_connection_count++;
GNUNET_STATISTICS_update (stats,
gettext_noop ("# active connections"),
1,
- GNUNET_NO);
+ GNUNET_NO);
+ }
}
@@ -1187,17 +1193,12 @@
const struct
GNUNET_PeerIdentity * peer)
{
- if (stat_connection_count > 0)
- {
- stat_connection_count--;
- GNUNET_STATISTICS_update (stats,
- gettext_noop ("# active connections"),
- -1,
- GNUNET_NO);
- return;
- }
- GNUNET_break(0);
-
+ GNUNET_assert (stat_connection_count > 0);
+ stat_connection_count--;
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# active connections"),
+ -1,
+ GNUNET_NO);
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11633 - gnunet/src/hostlist,
gnunet <=