mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-20 13:43:12 +00:00
Only respond with multiple matches if the key is the same
This commit is contained in:
parent
9669cda2b2
commit
3c69a45d42
@ -102,9 +102,11 @@ static void add_record(){
|
|||||||
static void respond(char *token, struct item *item){
|
static void respond(char *token, struct item *item){
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
if (item->_left && strcmp(item->key, item->_left->key)==0)
|
||||||
respond(token, item->_left);
|
respond(token, item->_left);
|
||||||
if (item->expires > gettime_ms())
|
if (item->expires > gettime_ms())
|
||||||
printf("%s|%s|\n",token,item->value);
|
printf("%s|%s|\n",token,item->value);
|
||||||
|
if (item->_right && strcmp(item->key, item->_right->key)==0)
|
||||||
respond(token, item->_right);
|
respond(token, item->_right);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user