mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-13 15:50:59 +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);
|
||||
#endif
|
||||
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;
|
||||
query->nodes[ix] = current->bheader->bucket->entries[z].gptr;
|
||||
xorix = current->xort[xorix].nextix;
|
||||
++loaded;
|
||||
}
|
||||
if (loaded >= query->max) break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user