ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi)
{
uint64_t id;
- ngx_quic_stream_t *qs, *nqs;
+ ngx_connection_t *pc;
+ ngx_quic_stream_t *nqs;
ngx_quic_connection_t *qc;
- qs = c->quic;
- qc = ngx_quic_get_connection(qs->parent);
+ pc = c->quic ? c->quic->parent : c;
+ qc = ngx_quic_get_connection(pc);
if (bidi) {
if (qc->streams.server_streams_bidi
qc->streams.server_streams_uni++;
}
- nqs = ngx_quic_create_stream(qs->parent, id);
+ nqs = ngx_quic_create_stream(pc, id);
if (nqs == NULL) {
return NULL;
}
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 keepalive handler");
- ngx_quic_finalize_connection(c, NGX_HTTP_V3_ERR_NO_ERROR,
- "keepalive timeout");
+ ngx_http_v3_finalize_connection(c, NGX_HTTP_V3_ERR_NO_ERROR,
+ "keepalive timeout");
}
#define ngx_http_quic_get_connection(c) \
- ((ngx_http_connection_t *) (c)->quic->parent->data)
+ ((ngx_http_connection_t *) ((c)->quic ? (c)->quic->parent->data \
+ : (c)->data))
#define ngx_http_v3_get_session(c) ngx_http_quic_get_connection(c)->v3_session
module)
#define ngx_http_v3_finalize_connection(c, code, reason) \
- ngx_quic_finalize_connection(c->quic->parent, code, reason)
+ ngx_quic_finalize_connection((c)->quic ? (c)->quic->parent : (c), \
+ code, reason)
#define ngx_http_v3_shutdown_connection(c, code, reason) \
- ngx_quic_shutdown_connection(c->quic->parent, code, reason)
+ ngx_quic_shutdown_connection((c)->quic ? (c)->quic->parent : (c), \
+ code, reason)
typedef struct {