mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:23:31 +03:00
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
This commit is contained in:
parent
f2f91ac709
commit
723c0e75fa
4 changed files with 67 additions and 40 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue