[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1094 - GNUnet/src/applications/topology_default
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1094 - GNUnet/src/applications/topology_default |
Date: |
Mon, 27 Jun 2005 07:48:15 -0700 (PDT) |
Author: grothoff
Date: 2005-06-27 07:48:12 -0700 (Mon, 27 Jun 2005)
New Revision: 1094
Modified:
GNUnet/src/applications/topology_default/topology.c
Log:
ping pong hackery
Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-06-27 14:25:43 UTC
(rev 1093)
+++ GNUnet/src/applications/topology_default/topology.c 2005-06-27 14:48:12 UTC
(rev 1094)
@@ -188,6 +188,13 @@
* @param hostId the peer that gave a sign of live
*/
static void notifyPONG(PeerIdentity * hostId) {
+ EncName enc;
+
+ hash2enc(&hostId->hashPubKey,
+ &enc);
+ LOG(LOG_DEBUG,
+ "Received pong from '%s', telling core that peer is still alive.\n",
+ (char*)&enc);
coreAPI->confirmSessionUp(hostId);
FREE(hostId);
}
@@ -199,6 +206,8 @@
void * unused) {
cron_t now;
cron_t act;
+ EncName enc;
+ PeerIdentity * hi;
cronTime(&now);
if (SYSERR == coreAPI->getLastActivityOf(peer, &act)) {
@@ -210,8 +219,13 @@
/* if we have less than 75% of the number of connections
that we would like to have, try ping-ing the other side
to keep the connection open instead of hanging up */
- PeerIdentity * hi = MALLOC(sizeof(PeerIdentity));
+ hi = MALLOC(sizeof(PeerIdentity));
*hi = *peer;
+ hash2enc(&hi->hashPubKey,
+ &enc);
+ LOG(LOG_DEBUG,
+ "Sending ping to '%s' to prevent connection timeout.\n",
+ (char*)&enc);
if (OK != pingpong->ping(peer,
NO,
(CronJob)¬ifyPONG,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1094 - GNUnet/src/applications/topology_default,
grothoff <=