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

Script

#!/bin/env sh

# http://haxx.se 
# http://daniel.haxx.se

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
@bagder
bagder / license.diff
Created April 25, 2022 21:29
MIT vs curl.license
--- MIT 2022-04-25 23:28:50.245418175 +0200
+++ curl.license 2022-04-25 23:25:31.659638391 +0200
@@ -1,14 +1,15 @@
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so.
+Permission to use, copy, modify, and distribute this software for any purpose
@bagder
bagder / license.diff
Created April 25, 2022 21:27
diff ISC vs curl license
--- ISC 2022-04-25 23:26:32.464186270 +0200
+++ curl.license 2022-04-25 23:25:31.659638391 +0200
@@ -1,11 +1,15 @@
-Permission to use, copy, modify, and /or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
+Permission to use, copy, modify, and distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright
+notice and this permission notice appear in all copies.
@bagder
bagder / 0001-http2-handle-DONE-called-for-the-paused-stream.patch
Created March 31, 2022 21:30
http2: handle DONE called for the paused stream
From 4fb969e547f0fcc59e7e40662d0b799b0581f03d Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <[email protected]>
Date: Thu, 31 Mar 2022 23:28:35 +0200
Subject: [PATCH] http2: handle DONE called for the paused stream
As it could otherwise stall all streams on the connection
---
lib/http2.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
@bagder
bagder / headers.json
Created March 17, 2022 22:53
headers as JSON
{
"Date": [
"Tue, 09 Nov 2010 14:49:00 GMT"
],
"Server": [
"test-server/fake"
],
"Last-Modified": [
"Tue, 13 Jun 2000 12:10:00 GMT"
],
@bagder
bagder / headers.md
Last active March 23, 2022 03:09
HTTP header access in curl

HTTP response header access in curl

This support depends on the new headers API work coming in PR 8593. Hopefully landing in 7.83.0.

This output is done with -w and new magic added to its abilties.

Output individual header contents

Say hello to %header{name} where name is the case insensitive name of the header withon colon.

@bagder
bagder / configure.patch
Last active February 21, 2022 16:13
configure patch to detect the msh3 library (without pkg-config)
From 7777d7bffac52b240ceedbb65d4dce75ade9874d Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <[email protected]>
Date: Mon, 21 Feb 2022 17:09:23 +0100
Subject: [PATCH] configure: detect msh3
---
configure.ac | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/configure.ac b/configure.ac
@bagder
bagder / h3-server-howto.md
Last active January 1, 2025 09:56
Setup an HTTP/3 test server

Setup a local HTTP/3 test server

... to toy with and run curl against it.

This is not advice on how to run anything in production. This is for development and experimenting.

Preqreqs

An existing local HTTP/1.1 server that hosts files. Preferably also a few huge ones.

@bagder
bagder / curl.h.diff
Created December 9, 2021 10:12
Apple's curl.h.diff
--- ./include/curl/curl.h 2021-12-09 11:01:40.994010630 +0100
+++ ../curl-curl-121.100.3/curl/include/curl/curl.h 2021-10-06 07:13:04.000000000 +0200
@@ -550,6 +550,7 @@
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
wasn't verified fine */
+ CURLE_SSL_CACERT = CURLE_PEER_FAILED_VERIFICATION, /* DEPRECATED: 60 - problem with the CA cert (path?) */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
@bagder
bagder / details.txt
Created November 25, 2021 16:02
Issue 41390: curl:curl_fuzzer_sftp: Heap-buffer-overflow in junkscan
Last Tested Stacktrace on revision a5f5687368a5f95415d58d37e8dfb10c6b6d44c5 (113 lines)
[Environment] ASAN_OPTIONS=alloc_dealloc_mismatch=0:allocator_may_return_null=1:allocator_release_to_os_interval_ms=500:allow_user_segv_handler=0:check_malloc_usable_size=0:detect_leaks=1:detect_odr_violation=0:detect_stack_use_after_return=1:fast_unwind_on_fatal=0:handle_abort=2:handle_segv=2:handle_sigbus=2:handle_sigfpe=2:handle_sigill=2:max_uar_stack_size_log=16:print_scariness=1:print_summary=1:print_suppressions=0:quarantine_size_mb=64:redzone=64:strict_memcmp=1:strip_path_prefix=/workspace/:symbolize=0:use_sigaltstack=1
+----------------------------------------Release Build Stacktrace----------------------------------------+
Command: /mnt/scratch0/clusterfuzz/resources/platform/linux/unshare -c -n /mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds-afl_curl_d1a7f12cc2e5055727a9c66d5eca203f3c8f5a6c/revisions/curl_fuzzer_sftp /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/crash
Time ran: 0.027436971664