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,10 +102,12 @@ 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;
|
||||||
respond(token, item->_left);
|
if (item->_left && strcmp(item->key, item->_left->key)==0)
|
||||||
|
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);
|
||||||
respond(token, item->_right);
|
if (item->_right && strcmp(item->key, item->_right->key)==0)
|
||||||
|
respond(token, item->_right);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_line(char *line){
|
static void process_line(char *line){
|
||||||
|
Loading…
Reference in New Issue
Block a user