tests/server: stop using libcurl string comparisons

Further untangle the test server code from curl code. While the string
comparison functions are available in the libcurl API, the tests servers
don't link with libcurl. Use native functions instead.

Closes #17328
This commit is contained in:
Daniel Stenberg 2025-05-12 22:48:47 +02:00
parent abd400a972
commit 47896d4b59
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 30 additions and 15 deletions

View file

@ -232,13 +232,15 @@ int curlx_str_newline(const char **linep)
return STRE_NEWLINE;
}
/* case insensitive compare that the parsed string matches the
given string. Returns non-zero on match. */
#ifndef WITHOUT_LIBCURL
/* case insensitive compare that the parsed string matches the given string.
Returns non-zero on match. */
int curlx_str_casecompare(struct Curl_str *str, const char *check)
{
size_t clen = check ? strlen(check) : 0;
return ((str->len == clen) && strncasecompare(str->str, check, clen));
}
#endif
/* case sensitive string compare. Returns non-zero on match. */
int curlx_str_cmp(struct Curl_str *str, const char *check)