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 / 1553-memory-leak
Created October 7, 2017 22:52
test 1553 without f3e03f6c0ac52a1bf3
daniel@storebror:~/src/curl/tests [master]$ ./runtests.pl 1553
********* System characteristics ********
* curl 7.56.0-DEV (x86_64-pc-linux-gnu)
* libcurl/7.56.0-DEV OpenSSL/1.1.0f zlib/1.2.8 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) libssh2/1.8.1_DEV nghttp2/1.26.0 librtmp/2.3
* Features: AsynchDNS Debug TrackMemory IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
* Host: storebror.haxx.se
* System: Linux storebror.haxx.se 4.12.0-2-amd64 #1 SMP Debian 4.12.13-1 (2017-09-19) x86_64 GNU/Linux
*
*** DISABLES memory tracking when using threaded resolver
*
@bagder
bagder / printrun.c
Created October 10, 2017 21:16
Test program for comparing sprintf() implementations
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
#include <curl/mprintf.h>
#define RUNS 10000000
/*#define curl_msnprintf snprintf*/
@bagder
bagder / lib651.c
Created October 12, 2017 17:46
test curl_formadd with huge COPYCONTENTS
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2017, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / threaded-shared-conn.c
Created December 1, 2017 10:36
multi-threaded libcurl example using a shared single connection cache
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2017, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / URLs-in-curl.md
Last active May 31, 2018 09:13
URLs are dangerous things

URLs are dangerous things

curl is a tool, libcurl is a library. They're used to retrieve or send data, where the source or destination is specified by a URL.

URL is short for Uniform Resource Locator and typically identifies a "resource" on a remote server.

This document discusses some aspects and precautions that need to be considered when applications pass URLs to curl or libcurl to work on.

@bagder
bagder / trrprefs.md
Last active May 31, 2025 00:43
This once held TRR prefs. Now it has moved.

NOTE

This content has moved.

Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!

diff --git a/lib/transfer.c b/lib/transfer.c
index fd9af3155..b5614f55f 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -715,11 +715,11 @@ static CURLcode readwrite_data(struct Curl_easy *data,
/* If it returned OK, we just keep going */
}
#endif /* CURL_DISABLE_HTTP */
/* Account for body content stored in the header buffer */
@bagder
bagder / dump.log
Created March 15, 2018 17:08
pacing.c output
* STATE: INIT => CONNECT handle 0x5606f2f2d348; line 1404 (connection #-5000)
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x5606f2f2d348; line 1440 (connection #0)
[warn] event_del_: event has no event_base set.
* Trying 127.0.0.1...
* TCP_NODELAY set
* STATE: WAITRESOLVE => WAITCONNECT handle 0x5606f2f2d348; line 1521 (connection #0)
* Connected to localhost (127.0.0.1) port 80 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x5606f2f2d348; line 1573 (connection #0)
* Marked for [keep alive]: HTTP default
@bagder
bagder / pause.c
Created March 16, 2018 10:47
attempt to repro pausing problem with multi_socket API
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <sys/poll.h>
#include <curl/curl.h>
#include <event2/event.h>
#include <event2/event_struct.h>
@bagder
bagder / gist:dda948616de144c14f84616b963a6deb
Created April 23, 2018 10:12
ftplistparser leak with cur-fuzzer
==29667==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 168 byte(s) in 1 object(s) allocated from:
#0 0x4d5358 (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x4d5358)
#1 0x523102 (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x523102)
#2 0x6c9492 (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x6c9492)
#3 0x6c9c3d (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x6c9c3d)
#4 0x5ca71d (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x5ca71d)
#5 0x5c9c20 (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x5c9c20)
#6 0x612a72 (/home/daniel/src/curl-fuzzer/curl_fuzzer+0x612a72)