[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r549 - GNUnet/src/applications/dht/module
From: |
grothoff |
Subject: |
[GNUnet-SVN] r549 - GNUnet/src/applications/dht/module |
Date: |
Fri, 1 Apr 2005 16:05:21 -0800 (PST) |
Author: grothoff
Date: 2005-04-01 16:05:18 -0800 (Fri, 01 Apr 2005)
New Revision: 549
Modified:
GNUnet/src/applications/dht/module/dht.c
Log:
fix
Modified: GNUnet/src/applications/dht/module/dht.c
===================================================================
--- GNUnet/src/applications/dht/module/dht.c 2005-04-01 23:50:51 UTC (rev
548)
+++ GNUnet/src/applications/dht/module/dht.c 2005-04-02 00:05:18 UTC (rev
549)
@@ -1228,10 +1228,9 @@
static void ping_reply_handler(const PeerIdentity * responder,
RPC_Param * results,
FindNodesContext * fnc) {
- unsigned int tableCount;
int i;
- DHT_TableId * tables;
EncName enc;
+ PeerInfo * pos;
ENTER();
GNUNET_ASSERT(! hostIdentityEquals(responder,
@@ -1241,20 +1240,22 @@
results);
if (fnc == NULL)
return;
-
+ /* update k-best list */
+ MUTEX_LOCK(&fnc->lock);
+ pos = findPeerInfo(responder);
/* does the peer support the table in question? */
if (! equalsHashCode512(&fnc->table,
&masterTableId)) {
- for (i=tableCount-1;i>=0;i--)
+ for (i=pos->tableCount-1;i>=0;i--)
if (equalsHashCode512(&fnc->table,
- &tables[i]))
+ &pos->tables[i]))
break;
- if (i == -1)
+ if (i == -1) {
+ MUTEX_UNLOCK(&fnc->lock);
return; /* peer does not support table in question */
+ }
}
- /* update k-best list */
- MUTEX_LOCK(&fnc->lock);
#if DEBUG_DHT
IFLOG(LOG_DEBUG,
hash2enc(&responder->hashPubKey,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r549 - GNUnet/src/applications/dht/module,
grothoff <=