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 / cookie.patch
Created January 27, 2017 12:01
[PATCH] cookies: do not assume a valid domain has a dot
@bagder
bagder / count-mallocs.c
Created April 22, 2017 17:48
libcurl test app to count mallocs based on multi-double.c
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / test-curl-install.sh
Created August 9, 2017 10:20
Verify make install installs the libcurl docs
#!/bin/sh
./maketgz 7.55.0-test
tar xf curl-7.55.0-test.tar.gz
cd curl-7.55.0-test
./configure --prefix=/tmp/curl-remove
make -sj
make install
ls /tmp/curl-remove/share/man/man3/
@bagder
bagder / report2release.pl
Created August 14, 2017 11:30
calculate number of days from a curl security report until release
#!/usr/bin/perl
# un-preprocessed _changes-file as input
require "./vuln.pm";
sub vernum {
my ($ver)=@_;
my @v = split('\.', $ver);
return ($v[0] << 16) | ($v[1] << 8) | $v[2];
@bagder
bagder / How-To-Test-gw-mac.md
Last active September 11, 2017 09:36
Test gw-mac on windows
@bagder
bagder / git-authors-active.pl
Last active September 12, 2017 19:41
Extract number of active authors in a git repository at the time of each commit
#!/usr/bin/perl
my @a = `git log --use-mailmap --reverse --pretty=fuller --no-color --date=short --decorate=full | egrep "^(Author|CommitDate):"`;
use Time::Piece;
sub delta {
my ($from, $to) = @_;
my $f = Time::Piece->strptime($from, "%Y-%m-%d");
my $t = Time::Piece->strptime($to, "%Y-%m-%d");
@bagder
bagder / curl-fresh-checkout-build.sh
Last active September 20, 2017 09:14
fresh curl checkout and build on debian
# install the basics
sudo apt install autoconf automake libtool libssl-dev libssh2-1-dev libz-dev libnghttp2-dev libpsl-dev
mkdir $HOME/src
cd $HOME/src
git clone https://github.com/curl/curl.git
cd curl
./buildconf
./configure --enable-debug --enable-maintainer-mode --disable-shared
@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, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
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 */