mirror of
https://github.com/curl/curl.git
synced 2026-08-26 02:43:31 +03:00
h3: fix query of concurrent streams
Queries gave wrong value or ran into NULL pointers when called at times when connection filter was not fully initialized. Closes #17886
This commit is contained in:
parent
74a94e699a
commit
695eee432f
3 changed files with 5 additions and 4 deletions
|
|
@ -2304,8 +2304,9 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf,
|
|||
case CF_QUERY_MAX_CONCURRENT: {
|
||||
#ifdef SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL
|
||||
/* Added in OpenSSL v3.3.x */
|
||||
uint64_t v;
|
||||
if(!SSL_get_value_uint(ctx->tls.ossl.ssl, SSL_VALUE_CLASS_GENERIC,
|
||||
uint64_t v = 0;
|
||||
if(ctx->tls.ossl.ssl &&
|
||||
!SSL_get_value_uint(ctx->tls.ossl.ssl, SSL_VALUE_CLASS_GENERIC,
|
||||
SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL, &v)) {
|
||||
CURL_TRC_CF(data, cf, "error getting available local bidi streams");
|
||||
return CURLE_HTTP3;
|
||||
|
|
|
|||
|
|
@ -1516,7 +1516,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf,
|
|||
switch(query) {
|
||||
case CF_QUERY_MAX_CONCURRENT: {
|
||||
curl_uint64_t max_streams = CONN_ATTACHED(cf->conn);
|
||||
if(!ctx->goaway) {
|
||||
if(!ctx->goaway && ctx->qconn) {
|
||||
max_streams += quiche_conn_peer_streams_left_bidi(ctx->qconn);
|
||||
}
|
||||
*pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue