}
}
- if (!lheader && !rheader) break;
-
+ if (!lheader && !rheader) {
+ break;
+ }
+
++insanity;
if (insanity > 159) {
assert(insanity <= 159);
}
- } while (max < query->count);
+ } while (max < query->max);
ks_dhtrt_load_query(query, &xort0);
}
if (e->flags == DHTPEER_SUSPECT) {
- ks_dhtrt_ping(e);
+ ks_dhtrt_ping(e);
continue;
}
for (uint8_t ix=0; ix<KS_DHT_BUCKETSIZE; ++ix) {
- if ( bucket->entries[ix].inuse == 1 &&
- (family == ifboth || bucket->entries[ix].family == family) &&
- (bucket->entries[ix].type & type) &&
+ if ( bucket->entries[ix].inuse == 1 && /* in use */
+ bucket->entries[ix].flags != DHTPEER_EXPIRED && /* not expired */
+ (family == ifboth || bucket->entries[ix].family == family) && /* match if family */
+ (bucket->entries[ix].type & type) && /* match type */
ks_dhtrt_isactive( &(bucket->entries[ix])) ) {
/* calculate xor value */
/* @todo */
/* set the appropriate command in the node and queue if for processing */
/*ks_dht_node_t *node = entry->gptr; */
+ /* ++entry->outstanding_pings; */
+
#ifdef KS_DHT_DEBUGPRINTF_
char buf[100];
printf(" ping queued for nodeid %s count %d\n",