Add secure libcurl transfer backend

This commit is contained in:
Mario Fetka
2026-07-14 17:01:03 +02:00
parent f3e6580ce5
commit 4a80e32f3e
19 changed files with 361 additions and 88 deletions
+3
View File
@@ -0,0 +1,3 @@
add_executable(url_parse_test url_parse_test.c)
target_link_libraries(url_parse_test PRIVATE prozilla)
add_test(NAME url_parse COMMAND url_parse_test)
+28
View File
@@ -0,0 +1,28 @@
#include <prozilla.h>
#include <url.h>
#include <stdio.h>
static int check(const char *text, uerr_t protocol, unsigned short port)
{
urlinfo url;
uerr_t result = proz_parse_url(text, &url, 0);
if (result != URLOK || url.proto != protocol || url.port != port)
{
fprintf(stderr, "failed to parse %s (result=%d protocol=%d port=%u)\n",
text, result, url.proto, url.port);
return 1;
}
proz_free_url(&url, 0);
return 0;
}
int main(void)
{
return check("http://example.invalid/file", URLHTTP, 80)
|| check("https://example.invalid/file", URLHTTPS, 443)
|| check("ftp://example.invalid/file", URLFTP, 21)
|| check("ftps://example.invalid/file", URLFTPS, 990)
|| check("sftp://example.invalid/file", URLSFTP, 22);
}