Skip to content

Instantly share code, notes, and snippets.

View bagder's full-sized avatar
⌨️
mostly typos

Daniel Stenberg bagder

⌨️
mostly typos
View GitHub Profile
@bagder
bagder / form.patch
Created September 22, 2023 13:19
formdata patch for 32 bit
diff --git a/lib/formdata.c b/lib/formdata.c
index 8984b6322..11b6f1687 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -787,10 +787,15 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len)
res = curl_mime_name(part, zname);
free(zname);
return res;
}
@bagder
bagder / 539.patch
Created August 28, 2023 06:19
fix for lib539.c ?
diff --git a/tests/libtest/lib539.c b/tests/libtest/lib539.c
index 0e8aada4b..75f146c00 100644
--- a/tests/libtest/lib539.c
+++ b/tests/libtest/lib539.c
@@ -68,11 +68,11 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD;
}
slist = curl_slist_append(NULL, "SYST");
if(!slist) {
@bagder
bagder / h2upgrade.patch
Last active July 31, 2023 14:59
patch for Richard W.M. Jones' "Curl segfault in curl_multi_perform"
diff --git a/lib/url.c b/lib/url.c
index 73f2da4ba..8eecfc421 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1071,10 +1071,13 @@ ConnectionExists(struct Curl_easy *data,
(needle->handler->protocol & PROTO_FAMILY_HTTP)));
#else
bool wantProxyNTLMhttp = FALSE;
#endif
#endif
@bagder
bagder / curl-in-two-hours-agenda.md
Last active February 17, 2024 12:08
Master curl in two hours. A video course by Daniel

The idea is to make a two and a half hour (give or take) video course explaining and detailing curl, the command line tool. How it works, how to use it, from the basics to some more advanced uses. This will be done by Daniel Stenberg, founder and lead developer of the curl project.

The recording and live-stream is scheduled for August 31, 2023. In the US morning and Euro evening.

See blog post for details.

The project (10 min)

@bagder
bagder / data.txt
Last active March 31, 2023 09:32
"python3 tests/http/scorecard.py --httpd h2" on git master on my machine on March 31 2023
scoring h2
TLS Handshake
localhost...ok.
curl.se...ipv4...ipv6...ok.
nghttp2.org...ipv4...ipv6...ok.
httpd downloads
https://one.http.curl.se:47541/score1.data: single...serial...parallel...ok.
https://one.http.curl.se:47541/score10.data: single...serial...parallel...ok.
https://one.http.curl.se:47541/score100.data: single...serial...parallel...ok.
httpd requests
@bagder
bagder / urlgen.pl
Last active December 25, 2024 16:08
perl script to generate URL variations for URL parser tests and benchmarks
#!/usr/bin/perl
# [scheme][divider][userinfo][hostname][port number][path][query][fragment]
my $num = $ARGV[0];
sub get_part
{
my ($part, $g) = @_;
my @a;
@bagder
bagder / urlencode.c
Created January 31, 2023 11:47
curl URL encode speed performance test program
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / urldecode.c
Created January 31, 2023 09:17
curl URL decode performance tester
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / h3-options.md
Last active January 13, 2023 23:32
How to select HTTP/3 when the support goes "release" for real

HTTP/3 options

  • "HTTP/3 please". Attempt to use HTTP/3 but fallback to h1/h2 if h3 does not work. This option makes curl try h3 first and if that has not succeeded after N milliseconds, a second attempt using TLS+TCP is initiated and then the first to connect wins and is used. This might then also make h3 not get used if it is too slow. In a future, if a significant portion of servers run HTTP/3, we could consider enabling this option by default.

  • "HTTP/3 only". Only try HTTP/3 against the given server and fail if h3 was

@bagder
bagder / 359.patch
Created January 2, 2023 09:05
test 359 first fix
diff --git a/lib/http2.c b/lib/http2.c
index 3c8674cbf..ead356307 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -391,12 +391,14 @@ static bool http2_connisdead(struct Curl_cfilter *cf, struct Curl_easy *data)
not in use by any other transfer, there shouldn't be any data here,
only "protocol frames" */
CURLcode result;
ssize_t nread = -1;