h3proxy: no stream userdata

Do not set the easy handle opening a proxy tunnel as userdata on the
stream. The ease handle might go out of scope long before the tunnel
stream is closed.

Closes #21962
This commit is contained in:
Stefan Eissing 2026-06-11 09:37:46 +02:00 committed by Daniel Stenberg
parent 946306b3e5
commit 8a867c2062
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -934,18 +934,17 @@ static CURLcode cf_h3_proxy_submit(struct Curl_cfilter *cf,
int rv;
DEBUGASSERT(stream->id == -1);
rv = ngtcp2_conn_open_bidi_stream(ctx->qconn, &sid, data);
/* Do NOT set `data` as stream user data. The transfer `data` may
* get cleaned up long before the tunnel goes down. */
rv = ngtcp2_conn_open_bidi_stream(ctx->qconn, &sid, NULL);
if(rv) {
failf(data, "cannot get bidi streams: %s", ngtcp2_strerror(rv));
result = CURLE_SEND_ERROR;
goto out;
}
stream->id = sid;
++ctx->used_bidi_streams;
/* Do NOT set `data` as stream user data. The transfer `data` may
* get cleaned up long before the tunnel goes down. */
ts->stream = stream;
++ctx->used_bidi_streams;
CURL_TRC_CF(data, cf, "[%" PRId64 "] opened bidi stream", sid);
}