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 / gist:1340630
Created November 4, 2011 22:16
linux 7.21.4
./src/curl -I https://admin:[email protected]/cms -kv
* About to connect() to db.insideguidance.com port 443 (#0)
* Trying 213.73.99.18... connected
* Connected to db.insideguidance.com (213.73.99.18) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
From 0e8573ef1d11b0f0a912223afda6f5802b54f5cd Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <[email protected]>
Date: Mon, 6 Feb 2012 23:27:12 +0100
Subject: [PATCH] sftp_read: avoid data *and* EAGAIN
Whenever we have data and is about to call a function that *MAY* return
EAGAIN we must return the data now and wait to get called again. Our API
only allows data *or* EAGAIN and we must never try to get both.
---
src/sftp.c | 43 +++++++++++++++++++++++++------------------
@bagder
bagder / foss-sthlm-12-curl-snack
Created February 6, 2013 08:12
beskrivning av mitt föredrag 5:e mars på foss-sthlm. eller så.
curl and new technologies by Daniel Stenberg
============================================
curl and libcurl[1] was started in 1998 and is currently possibly used by more
than 500 million users regularly. It is widely considered to be the defacto
multi platform URL transfer library and it is the empowering foundation of
countless open source and proprietary apps in addition to millions of sites
and products.
This talk is partly a look back at how the cURL project ended up like this
/* Trying to repeat bug report 1426
https://sourceforge.net/p/curl/bugs/1426/ */
#include <stdio.h>
#include <string.h>
/* somewhat unix-specific */
#include <sys/time.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static void on_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
{
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static void on_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
@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 ;

Keybase proof

I hereby claim:

  • I am bagder on github.
  • I am bagder (https://keybase.io/bagder) on keybase.
  • I have a public key whose fingerprint is 27ED EAF2 2F3A BCEB 50DB 9A12 5CC9 08FD B71E 12C2

To claim this, I am signing this object:

@bagder
bagder / demo_code2.c
Created September 15, 2016 21:25
for curl issue 1013
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
#define MULTI_PART_CONTENT_TYPE_AUDIO "application/octet-stream"
#define MULTI_PART_CONTENT_TYPE_JSON "application/json; charset=UTF-8"
#define DATA_SIZE 10
#define AUDIO_FILE_PATH "sample.wav"
"Mozilla/5.0 (compatible; MSIE 11.0; Windows NT 6.2 Trident/5.0; ; ARM; Touch; WPDesktopSLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; Tablet PC 2.0SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; MS-RTC LM 8SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8; .NET CLR 1.1.4322InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64.NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; MATMJS.NET4.0E; .NET4.0C; Media Center PC 6.0; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; AskTB5.6; EIE10;NLNLWOLSLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8SLCC2; .NET CLR 2.0.507