lib: drop two interim macros in favor of native libcurl API calls

Drop `strcasecompare` and `strncasecompare` in favor of libcurl API
calls `curl_strequal` and `curl_strnequal` respectively.

Also drop unnecessary `strcase.h` includes. Include `curl/curl.h`
instead where it wasn't included before.

Closes #17772
This commit is contained in:
Viktor Szakats 2025-06-28 12:17:30 +02:00
parent d553f7e9f0
commit a3787f98ac
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
54 changed files with 223 additions and 260 deletions

View file

@ -78,7 +78,6 @@
#include "vquic/vquic.h" /* for quic cfilters */
#include "http_proxy.h"
#include "socks.h"
#include "strcase.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@ -90,15 +89,15 @@
enum alpnid Curl_alpn2alpnid(const char *name, size_t len)
{
if(len == 2) {
if(strncasecompare(name, "h1", 2))
if(curl_strnequal(name, "h1", 2))
return ALPN_h1;
if(strncasecompare(name, "h2", 2))
if(curl_strnequal(name, "h2", 2))
return ALPN_h2;
if(strncasecompare(name, "h3", 2))
if(curl_strnequal(name, "h3", 2))
return ALPN_h3;
}
else if(len == 8) {
if(strncasecompare(name, "http/1.1", 8))
if(curl_strnequal(name, "http/1.1", 8))
return ALPN_h1;
}
return ALPN_none; /* unknown, probably rubbish input */