summaryrefslogtreecommitdiff
path: root/lib/http.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-02-15 08:35:32 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-02-15 16:33:53 +0100
commit723c0e75fa3e74cdad5ad2b3c130f9b974e89ef1 (patch)
treecd449973e61d8799afbe53c9b643af4a071b17f4 /lib/http.h
parentf2f91ac709bcfc85ce0447c3ab6b7e41efef8606 (diff)
downloadcurl-723c0e75fa3e74cdad5ad2b3c130f9b974e89ef1.tar.gz
http2: remove conn->data use
... but instead use a private alternative that points to the "driving transfer" from the connection. We set the "user data" associated with the connection to be the connectdata struct, but when we drive transfers the code still needs to know the pointer to the transfer. We can change the user data to become the Curl_easy handle, but with older nghttp2 version we cannot dynamically update that pointer properly when different transfers are used over the same connection. Closes #6520
Diffstat (limited to 'lib/http.h')
-rw-r--r--lib/http.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/http.h b/lib/http.h
index 28f9341f6..587e032cd 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -251,9 +251,16 @@ struct h2settings {
struct http_conn {
#ifdef USE_NGHTTP2
#define H2_BINSETTINGS_LEN 80
- nghttp2_session *h2;
uint8_t binsettings[H2_BINSETTINGS_LEN];
size_t binlen; /* length of the binsettings data */
+
+ /* We associate the connnectdata struct with the connection, but we need to
+ make sure we can identify the current "driving" transfer. This is a
+ work-around for the lack of nghttp2_session_set_user_data() in older
+ nghttp2 versions that we want to support. (Added in 1.31.0) */
+ struct Curl_easy *trnsfr;
+
+ nghttp2_session *h2;
Curl_send *send_underlying; /* underlying send Curl_send callback */
Curl_recv *recv_underlying; /* underlying recv Curl_recv callback */
char *inbuf; /* buffer to receive data from underlying socket */