mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 16:58:35 +00:00
FS-9775: correct ks_dhtrt_closest_nodes query results
This commit is contained in:
parent
5fa53dae50
commit
b3bcc76db1
@ -1030,9 +1030,12 @@ uint8_t ks_dhtrt_load_query(ks_dhtrt_querynodes_t *query, ks_dhtrt_sortedxors_t
|
|||||||
ks_dhtrt_printableid(current->bheader->mask,buf), current->count);
|
ks_dhtrt_printableid(current->bheader->mask,buf), current->count);
|
||||||
#endif
|
#endif
|
||||||
int xorix = current->startix;
|
int xorix = current->startix;
|
||||||
for (uint8_t ix = 0; ix< current->count && loaded < query->max; ++ix ) {
|
for (uint8_t ix = 0;
|
||||||
|
ix< current->count && loaded < query->max && xorix != KS_DHT_BUCKETSIZE;
|
||||||
|
++ix ) {
|
||||||
unsigned int z = current->xort[xorix].ix;
|
unsigned int z = current->xort[xorix].ix;
|
||||||
query->nodes[ix] = current->bheader->bucket->entries[z].gptr;
|
query->nodes[ix] = current->bheader->bucket->entries[z].gptr;
|
||||||
|
xorix = current->xort[xorix].nextix;
|
||||||
++loaded;
|
++loaded;
|
||||||
}
|
}
|
||||||
if (loaded >= query->max) break;
|
if (loaded >= query->max) break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user