Skip to content

Instantly share code, notes, and snippets.

View kunalekawde's full-sized avatar

Kunal Ekawde kunalekawde

  • kekawde@microsoft.com
View GitHub Profile
@kunalekawde
kunalekawde / PRI
Created May 29, 2020 18:58
multiplex 1.1 with 2.0 requests, 1.1 request is sent on 2.0 connection
diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c
index 333b7df2c..273eaacee 100644
--- a/docs/examples/http2-download.c
+++ b/docs/examples/http2-download.c
@@ -47,7 +47,7 @@ struct transfer {
FILE *out;
};
-#define NUM_HANDLES 1000
+#define NUM_HANDLES 10008
@kunalekawde
kunalekawde / gdb_details_connreuse.txt
Created January 27, 2020 12:03
gbd info connection reuse
(gdb) p *check->data
$4 = {
next = 0x0,
prev = 0x0,
conn = 0x0,
connect_queue = {
ptr = 0x0,
prev = 0x0,
next = 0x0
},
@kunalekawde
kunalekawde / http2-download_2.c
Created January 6, 2020 11:10
http/2 connection reuse
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@kunalekawde
kunalekawde / connection_reuse.patch
Created January 4, 2020 12:55
connection_reuse patch
diff -urNp curl-7.67.0/lib/url.c curl-7.67.0/lib/url.c
--- curl-7.67.0/lib/url.c 2020-01-02 03:46:39.358670000 -0500
+++ curl-7.67.0/lib/url.c 2020-01-03 01:25:53.847411000 -0500
@@ -1072,6 +1072,8 @@ ConnectionExists(struct Curl_easy *data,
while(curr) {
bool match = FALSE;
size_t multiplexed;
+ size_t multiplexed_cnt;
+ multiplexed_cnt = CONN_INUSE(check);
@kunalekawde
kunalekawde / http2-download.c
Created December 18, 2019 09:42
connection reuse
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@kunalekawde
kunalekawde / 4043_1.c
Created June 20, 2019 11:47
4043 reproduce attempt
/***************************************************************************
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>
diff -urNp curl-7.65.1/lib/conncache.c curl-7.65.1/lib/conncache.c
--- curl-7.65.1/lib/conncache.c 2019-06-05 06:27:58.438954000 -0400
+++ curl-7.65.1/lib/conncache.c 2019-06-16 02:31:56.343444000 -0400
@@ -189,6 +189,11 @@ void Curl_conncache_unlock(struct Curl_e
CONN_UNLOCK(data);
}
+void Curl_conncache_lock(struct Curl_easy *data)
+{
+ CONN_LOCK(data);
#include <string.h>
#include <curl/curl.h>
#include <unistd.h>
fd_set wfds;
fd_set rfds;
struct timeval tv;
int maxfd = 0;
int socket_callback(CURL *easy, /* easy handle */
@kunalekawde
kunalekawde / test.c
Created June 12, 2019 23:35
sample program for libcurl assertion / busy loop
#include <string.h>
#include <curl/curl.h>
fd_set wfds;
fd_set rfds;
struct timeval tv;
int maxfd = 0;
int socket_callback(CURL *easy, /* easy handle */
curl_socket_t s, /* socket */