Skip to content

Instantly share code, notes, and snippets.

🎩
typos and segfaults

Daniel Stenberg bagder

🎩
typos and segfaults
Block or report user

Report or block bagder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 4043-end-properly.c
#include <string.h>
#include <curl/curl.h>
#include <assert.h>
#include <unistd.h>
fd_set wfds;
fd_set rfds;
struct timeval tv;
int maxfd = 0;
View 4043.c
/***************************************************************************
Attempt to reproduce https://github.com/curl/curl/issues/4043
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* somewhat unix-specific */
#include <sys/time.h>
@bagder
bagder / maxage-sharedconn.c
Created Jun 17, 2019
test CURLOPT_MAXAGE_CONN with shared connections
View maxage-sharedconn.c
#include <stdio.h>
#include <unistd.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
CURLSH *shobject = curl_share_init();
@bagder
bagder / maxage-conn.c
Created Jun 17, 2019
verify that libcurl's MAXAGE_CONN option behaves
View maxage-conn.c
#include <stdio.h>
#include <unistd.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
@bagder
bagder / indent-sample.c
Created May 28, 2019
this is how I'd do it
View indent-sample.c
{
IF_NAMETOINDEX_FN pIfNameToIndex =
CURLX_FUNCTION_CAST(IF_NAMETOINDEX_FN,
(GetProcAddress(s_hIpHlpApiDll, "if_nametoindex")));
}
@bagder
bagder / quinq.c
Created Mar 27, 2019
attempt to reproduce a POST issue
View quinq.c
#include <curl/curl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define POSTFILE "debugit"
#define synurl "localhost"
#define ctimeout 10L
int main (void)
@bagder
bagder / issue-3629.c
Created Feb 28, 2019
source example trying to reproduce curl issue #3629
View issue-3629.c
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / cookie.patch
Created Feb 26, 2019
flush cookies fix
View cookie.patch
@bagder
bagder / issue-3602.c
Last active Feb 24, 2019
An attempt to reproduce curl issue 3602 with a sample written in C
View issue-3602.c
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / stringify.c
Created Feb 22, 2019
convert a given define to a string
View stringify.c
#include <stdio.h>
#define xstr(s) str(s)
#define str(s) #s
int main(void)
{
printf("%s\n", xstr(STRING));
return 0;
}
You can’t perform that action at this time.