[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1336 - GNUnet/src/applications/advertising GNUnet/src/appl
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1336 - GNUnet/src/applications/advertising GNUnet/src/applications/session GNUnet/src/applications/topology_default GNUnet/src/transports GNUnet/src/util gnunet-gtk/src/core |
Date: |
Fri, 8 Jul 2005 17:08:20 -0700 (PDT) |
Author: grothoff
Date: 2005-07-08 17:08:11 -0700 (Fri, 08 Jul 2005)
New Revision: 1336
Modified:
GNUnet/src/applications/advertising/advertising.c
GNUnet/src/applications/session/connect.c
GNUnet/src/applications/topology_default/topology.c
GNUnet/src/transports/tcp.c
GNUnet/src/util/initialize.c
gnunet-gtk/src/core/main.c
Log:
sync
Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c 2005-07-09 00:08:00 UTC
(rev 1335)
+++ GNUnet/src/applications/advertising/advertising.c 2005-07-09 00:08:11 UTC
(rev 1336)
@@ -425,7 +425,9 @@
const int * prob) {
SendData sd;
cron_t now;
-
+
+ if (getNetworkLoadUp() > 100)
+ return; /* network load too high... */
if (0 != randomi(*prob))
return; /* ignore */
#if DEBUG_HELOEXCHANGE
@@ -472,6 +474,10 @@
static void broadcastHELO(void * unused) {
unsigned int i;
+ if (getNetworkLoadUp() > 100)
+ return; /* network load too high... */
+ if (getCPULoad() > 100)
+ return; /* CPU load too high... */
i = transport->forEach(NULL,
NULL);
transport->forEach((TransportCallback)&broadcastHELOTransport,
@@ -486,6 +492,8 @@
static void forwardCallback(const PeerIdentity * peer,
FCC * fcc) {
+ if (getNetworkLoadUp() > 100)
+ return; /* network load too high... */
if (randomi(fcc->prob) != 0)
return; /* only forward with a certain chance */
if (equalsHashCode512(&peer->hashPubKey,
@@ -505,14 +513,17 @@
*/
static void
forwardHELOHelper(const PeerIdentity * peer,
- const unsigned short protocol,
+ unsigned short protocol,
int confirmed,
- int * probability) {
+ void * data) {
+ int * probability = data;
HELO_Message * helo;
TIME_T now;
int count;
FCC fcc;
+ if (getNetworkLoadUp() > 100)
+ return; /* network load too high... */
if (confirmed == NO)
return;
if (protocol == NAT_PROTOCOL_NUMBER)
@@ -570,6 +581,8 @@
forwardHELO(void * unused) {
int count;
+ if (getCPULoad() > 100)
+ return; /* CPU load too high... */
#if DEBUG_HELOEXCHANGE
LOG(LOG_CRON,
"Enter '%s'.\n",
@@ -579,7 +592,7 @@
NULL,
NULL);
identity->forEachHost(0, /* ignore blacklisting */
- (HostIterator)&forwardHELOHelper,
+ &forwardHELOHelper,
&count);
#if DEBUG_HELOEXCHANGE
LOG(LOG_CRON,
Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c 2005-07-09 00:08:00 UTC (rev
1335)
+++ GNUnet/src/applications/session/connect.c 2005-07-09 00:08:11 UTC (rev
1336)
@@ -37,7 +37,7 @@
#define HELO_HELPER_TABLE_START_SIZE 64
-#define DEBUG_SESSION YES
+#define DEBUG_SESSION NO
#define EXTRA_CHECKS YES
Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-07-09 00:08:00 UTC
(rev 1335)
+++ GNUnet/src/applications/topology_default/topology.c 2005-07-09 00:08:11 UTC
(rev 1336)
@@ -154,6 +154,9 @@
cron_t now;
EncName enc;
+ if (getNetworkLoadUp() > 100)
+ return; /* bandwidth saturated, do not
+ push it higher! */
cronTime(&now);
indexMatch.index = index;
indexMatch.matchCount = 0;
Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2005-07-09 00:08:00 UTC (rev 1335)
+++ GNUnet/src/transports/tcp.c 2005-07-09 00:08:11 UTC (rev 1336)
@@ -30,7 +30,7 @@
#include "platform.h"
#include "ip.h"
-#define DEBUG_TCP YES
+#define DEBUG_TCP NO
/**
* after how much time of the core not being associated with a tcp
Modified: GNUnet/src/util/initialize.c
===================================================================
--- GNUnet/src/util/initialize.c 2005-07-09 00:08:00 UTC (rev 1335)
+++ GNUnet/src/util/initialize.c 2005-07-09 00:08:11 UTC (rev 1336)
@@ -114,7 +114,7 @@
setlocale (LC_ALL, "");
BINDTEXTDOMAIN(PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
+ textdomain(PACKAGE);
gnunet_util_initIO();
initLockingGcrypt();
Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c 2005-07-09 00:08:00 UTC (rev 1335)
+++ gnunet-gtk/src/core/main.c 2005-07-09 00:08:11 UTC (rev 1336)
@@ -98,6 +98,8 @@
argv,
&parseOptions))
return 0;
+ BINDTEXTDOMAIN(PACKAGE, PACKAGE_LOCALE_DIR);
+ textdomain(PACKAGE);
startCron();
initGNUnetGTKCommon();
root
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1336 - GNUnet/src/applications/advertising GNUnet/src/applications/session GNUnet/src/applications/topology_default GNUnet/src/transports GNUnet/src/util gnunet-gtk/src/core,
grothoff <=