[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1099 - in GNUnet/src: applications/pingpong applications/t
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1099 - in GNUnet/src: applications/pingpong applications/topology_default server |
Date: |
Mon, 27 Jun 2005 11:58:45 -0700 (PDT) |
Author: grothoff
Date: 2005-06-27 11:58:38 -0700 (Mon, 27 Jun 2005)
New Revision: 1099
Modified:
GNUnet/src/applications/pingpong/pingpong.c
GNUnet/src/applications/topology_default/topology.c
GNUnet/src/server/connection.c
GNUnet/src/server/tcpserver.c
Log:
up
Modified: GNUnet/src/applications/pingpong/pingpong.c
===================================================================
--- GNUnet/src/applications/pingpong/pingpong.c 2005-06-27 17:10:29 UTC (rev
1098)
+++ GNUnet/src/applications/pingpong/pingpong.c 2005-06-27 18:58:38 UTC (rev
1099)
@@ -183,6 +183,9 @@
int i;
PINGPONG_Message * pmsg;
PingPongEntry * entry;
+#if DEBUG_PINGPONG
+ EncName enc;
+#endif
pmsg = (PINGPONG_Message *) msg;
if ( (ntohs(msg->size) != sizeof(PINGPONG_Message)) ||
@@ -193,6 +196,13 @@
"pong");
return SYSERR; /* bad pong */
}
+#if DEBUG_PINGPONG
+ hash2enc(&sender->hashPubKey,
+ &enc);
+ LOG(LOG_DEBUG,
+ "Received PONG from '%s'.\n",
+ &enc);
+#endif
MUTEX_LOCK(pingPongLock);
for (i=0;i<MAX_PING_PONG;i++) {
entry = &pingPongs[i];
Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-06-27 17:10:29 UTC
(rev 1098)
+++ GNUnet/src/applications/topology_default/topology.c 2005-06-27 18:58:38 UTC
(rev 1099)
@@ -57,6 +57,12 @@
*/
#define LIVE_SCAN_EFFECTIVENESS 10
+/**
+ * Value > 1 that determines the chance (1:LPE) that the cron job
+ * actually tries to ping a peer that is about to time-out.
+ */
+#define LIVE_PING_EFFECTIVENESS 100
+
static CoreAPIForApplication * coreAPI;
static Identity_ServiceAPI * identity;
@@ -261,7 +267,7 @@
"YES")) )
scanForHosts(i);
}
- if (randomi(LIVE_SCAN_EFFECTIVENESS) == 0)
+ if (randomi(LIVE_PING_EFFECTIVENESS) == 0)
active = coreAPI->forAllConnectedNodes
(&checkNeedForPing,
NULL);
Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c 2005-06-27 17:10:29 UTC (rev 1098)
+++ GNUnet/src/server/connection.c 2005-06-27 18:58:38 UTC (rev 1099)
@@ -2178,6 +2178,7 @@
cron_t * time) {
int ret;
BufferEntry * be;
+
ret = 0;
MUTEX_LOCK(&lock);
be = lookForHost(peer);
@@ -2486,7 +2487,7 @@
EncName hostName;
EncName skey_local;
EncName skey_remote;
- unsigned short ttype;
+ unsigned int ttype;
MUTEX_LOCK(&lock);
ENTRY();
@@ -2496,19 +2497,20 @@
if (tmp->status != STAT_DOWN) {
IFLOG(LOG_MESSAGE,
hash2enc(&tmp->session.sender.hashPubKey,
- &hostName));
- IFLOG(LOG_MESSAGE,
+ &hostName);
hash2enc((HashCode512*) &tmp->skey_local,
- &skey_local);)
- IFLOG(LOG_MESSAGE,
+ &skey_local);
hash2enc((HashCode512*) &tmp->skey_remote,
&skey_remote));
+ hostName.encoding[4] = '\0';
+ skey_local.encoding[4] = '\0';
+ skey_remote.encoding[4] = '\0';
ttype = 0;
if (tmp->session.tsession != NULL)
ttype = tmp->session.tsession->ttype;
LOG(LOG_MESSAGE,
"CONNECTION-TABLE: %3d-%1d-%2d-%4ds"
- " (of %ds) BPM %4ur %4ut-%3u: %20s-%8s-%8s\n",
+ " (of %ds) BPM %4llu %8ut-%3u: %s-%s-%s\n",
i,
tmp->status,
ttype,
Modified: GNUnet/src/server/tcpserver.c
===================================================================
--- GNUnet/src/server/tcpserver.c 2005-06-27 17:10:29 UTC (rev 1098)
+++ GNUnet/src/server/tcpserver.c 2005-06-27 18:58:38 UTC (rev 1099)
@@ -509,6 +509,8 @@
otherwise we just close and reject the communication! */
IPaddr ipaddr;
+
+ printConnectionBuffer();
GNUNET_ASSERT(sizeof(struct in_addr) == sizeof(IPaddr));
memcpy(&ipaddr,
&clientAddr.sin_addr,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1099 - in GNUnet/src: applications/pingpong applications/topology_default server,
grothoff <=