DEBUGASSERT(pres1);
CF_DATA_SAVE(save, cf, data);
- if(nghttp2_session_check_request_allowed(ctx->h2) == 0) {
+ if(!ctx->h2 || !nghttp2_session_check_request_allowed(ctx->h2)) {
/* the limit is what we have in use right now */
effective_max = CONN_ATTACHED(cf->conn);
}
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;
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;