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 / agenda.md
Last active October 23, 2023 07:44
A two to three hour libcurl video tutorial

This is going to become a live-stream video "class" done by Daniel in November 2023. Also recorded for Youtube of course.

The exact date/time is pending. This is the tentative agenda. What are you missing from here?

Mastering libcurl

  • The project
  • Getting libcurl
  • API and ABI
  • Architecture
@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 / http3.php
Last active July 26, 2023 14:33
HTTP/3 with PHP/CURL
if (!defined('CURL_HTTP_VERSION_3')) {
define('CURL_HTTP_VERSION_3', 30);
}
$ch = curl_init("https://cloudflare-quic.com/");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3);
curl_exec($ch);
@bagder
bagder / simple-doh.c
Created June 18, 2018 11:40
libcurl example using DOH
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
@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 / stream-upload-formpost.c
Last active February 21, 2023 05:24
libcurl multipart formpost without content-length
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
#define MULTI_PART_CONTENT_TYPE_AUDIO "application/octet-stream"
#define DATA_SIZE 10
char demoBuffer[DATA_SIZE] = {1,2,3,4,5,6,7,8,9,0};
const char *metadata = "I am metadata";
int Curr_index ;
@bagder
bagder / FOSDEMgeddon.md
Last active February 3, 2023 10:35
FOSDEMgeddon, the game

FOSDEMgeddon

(The rules were originally created for FOSDEM 2019)

  • You get one point for each FOSDEM talk you mean to attend but cannot enter because there is a FULL sign on the door.

  • The FOSDEM talk must be a talk in the official program to qualify for points.

  • You are not allowed to hunt down such rooms with the purpose of finding FULL

@bagder
bagder / urlencode.c
Created January 31, 2023 11:47
curl URL encode speed performance test program
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which