[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1194 - in GNUnet/src: applications/bootstrap_http server
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1194 - in GNUnet/src: applications/bootstrap_http server |
Date: |
Fri, 1 Jul 2005 11:44:07 -0700 (PDT) |
Author: grothoff
Date: 2005-07-01 11:44:03 -0700 (Fri, 01 Jul 2005)
New Revision: 1194
Modified:
GNUnet/src/applications/bootstrap_http/http.c
GNUnet/src/server/core.c
Log:
up
Modified: GNUnet/src/applications/bootstrap_http/http.c
===================================================================
--- GNUnet/src/applications/bootstrap_http/http.c 2005-07-01 18:29:01 UTC
(rev 1193)
+++ GNUnet/src/applications/bootstrap_http/http.c 2005-07-01 18:44:03 UTC
(rev 1194)
@@ -29,6 +29,7 @@
#include "gnunet_core.h"
#include "gnunet_protocols.h"
#include "gnunet_bootstrap_service.h"
+#include "gnunet_stats_service.h"
#define TCP_HTTP_PORT 80
#define HTTP_URL "http://"
@@ -39,7 +40,15 @@
*/
static struct sockaddr_in theProxy;
+/**
+ * Stats service (maybe NULL!)
+ */
+static Stats_ServiceAPI * stats;
+static CoreAPIForApplication * coreAPI;
+
+static int stat_HELOdownloaded;
+
/**
* Download hostlist from the web and call method
* on each HELO.
@@ -243,6 +252,9 @@
break;
}
helo->header.size = htons(HELO_Message_size(helo));
+ if (stats != NULL)
+ stats->change(stat_HELOdownloaded,
+ 1);
callback(helo,
arg);
}
@@ -330,11 +342,20 @@
theProxy.sin_addr.s_addr = 0;
}
+ coreAPI = capi;
+ stats = coreAPI->requestService("stats");
+ if (stats != NULL) {
+ stat_HELOdownloaded
+ = stats->create(_("# HELOs downloaded via http"));
+ }
api.bootstrap = &downloadHostlist;
return &api;
}
void release_module_bootstrap() {
+ if (stats != NULL)
+ coreAPI->releaseService(stats);
+ coreAPI = NULL;
}
/* end of http.c */
Modified: GNUnet/src/server/core.c
===================================================================
--- GNUnet/src/server/core.c 2005-07-01 18:29:01 UTC (rev 1193)
+++ GNUnet/src/server/core.c 2005-07-01 18:44:03 UTC (rev 1194)
@@ -384,6 +384,8 @@
ShutdownList * prev;
ApplicationDoneMethod mptr;
+ if (service == NULL)
+ return OK;
prev = NULL;
pos = shutdownList;
while ( (pos != NULL) &&
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1194 - in GNUnet/src: applications/bootstrap_http server,
grothoff <=