Refactor, create svc_find_by_cond() from api.c callback

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-08-18 14:00:02 +02:00
1 parent 12e341fe73
commit e589c5b269
3 files changed
+26 -14

No files matched your search

+1 -12
View File
@@ -206,7 +206,6 @@ static svc_t *do_find(char *buf, size_t len)
static svc_t *do_find_byc(char *buf, size_t len)
{
svc_t *svc, *iter = NULL;
char *input;
input = sanitize(buf, len);
@@ -215,17 +214,7 @@ static svc_t *do_find_byc(char *buf, size_t len)
return NULL;
}
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) {
char cond[MAX_COND_LEN];
mkcond(svc, cond, sizeof(cond));
_d("Comparing input %s with cond %s", input, cond);
if (string_compare(cond, input))
return svc;
}
_d("None found");
return NULL;
return svc_find_by_cond(input);
}
static void bypass_shutdown(void *);