}
h3c->max_push_id = (uint64_t) -1;
+ h3c->goaway_push_id = (uint64_t) -1;
ngx_queue_init(&h3c->blocked);
ngx_queue_init(&h3c->pushing);
ngx_uint_t npushing;
uint64_t next_push_id;
uint64_t max_push_id;
+ uint64_t goaway_push_id;
ngx_uint_t goaway; /* unsigned goaway:1; */
return NGX_ABORT;
}
+ if (h3c->goaway_push_id != (uint64_t) -1) {
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
+ "http3 abort pushes due to goaway");
+ return NGX_ABORT;
+ }
+
if (h3c->npushing >= h3scf->max_concurrent_pushes) {
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http3 abort pushes due to max_concurrent_pushes");
sw_cancel_push,
sw_settings,
sw_max_push_id,
+ sw_goaway,
sw_skip
};
st->state = sw_max_push_id;
break;
+ case NGX_HTTP_V3_FRAME_GOAWAY:
+ st->state = sw_goaway;
+ break;
+
default:
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http3 parse skip unknown frame");
st->state = sw_type;
break;
+ case sw_goaway:
+
+ rc = ngx_http_v3_parse_varlen_int(c, &st->vlint, ch);
+
+ if (--st->length == 0 && rc == NGX_AGAIN) {
+ return NGX_HTTP_V3_ERR_FRAME_ERROR;
+ }
+
+ if (rc != NGX_DONE) {
+ return rc;
+ }
+
+ rc = ngx_http_v3_goaway(c, st->vlint.value);
+ if (rc != NGX_OK) {
+ return rc;
+ }
+
+ st->state = sw_type;
+ break;
+
case sw_skip:
if (--st->length == 0) {
}
+ngx_int_t
+ngx_http_v3_goaway(ngx_connection_t *c, uint64_t push_id)
+{
+ ngx_http_v3_session_t *h3c;
+
+ h3c = ngx_http_v3_get_session(c);
+
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 GOAWAY:%uL", push_id);
+
+ h3c->goaway_push_id = push_id;
+
+ return NGX_OK;
+}
+
+
ngx_int_t
ngx_http_v3_cancel_push(ngx_connection_t *c, uint64_t push_id)
{
uint64_t push_id);
ngx_int_t ngx_http_v3_set_max_push_id(ngx_connection_t *c,
uint64_t max_push_id);
+ngx_int_t ngx_http_v3_goaway(ngx_connection_t *c, uint64_t push_id);
ngx_int_t ngx_http_v3_cancel_push(ngx_connection_t *c, uint64_t push_id);
ngx_int_t ngx_http_v3_cancel_stream(ngx_connection_t *c, ngx_uint_t stream_id);