Mercurial > hg > nginx-quic
comparison src/event/quic/ngx_event_quic_streams.c @ 8638:1ead7d64e993 quic
QUIC: send RESET_STREAM in response to STOP_SENDING.
As per RFC 9000:
An endpoint that receives a STOP_SENDING frame MUST send a RESET_STREAM
frame if the stream is in the "Ready" or "Send" state.
An endpoint SHOULD copy the error code from the STOP_SENDING frame to
the RESET_STREAM frame it sends, but it can use any application error code.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 21 Sep 2021 16:24:33 +0300 |
parents | 13cb758e6ac0 |
children | 66b4ff373dd9 |
comparison
equal
deleted
inserted
replaced
8637:13cb758e6ac0 | 8638:1ead7d64e993 |
---|---|
1251 | 1251 |
1252 ngx_int_t | 1252 ngx_int_t |
1253 ngx_quic_handle_stop_sending_frame(ngx_connection_t *c, | 1253 ngx_quic_handle_stop_sending_frame(ngx_connection_t *c, |
1254 ngx_quic_header_t *pkt, ngx_quic_stop_sending_frame_t *f) | 1254 ngx_quic_header_t *pkt, ngx_quic_stop_sending_frame_t *f) |
1255 { | 1255 { |
1256 ngx_pool_t *pool; | |
1256 ngx_event_t *wev; | 1257 ngx_event_t *wev; |
1257 ngx_connection_t *sc; | 1258 ngx_connection_t *sc; |
1258 ngx_quic_stream_t *qs; | 1259 ngx_quic_stream_t *qs; |
1259 ngx_quic_connection_t *qc; | 1260 ngx_quic_connection_t *qc; |
1260 | 1261 |
1280 return NGX_OK; | 1281 return NGX_OK; |
1281 } | 1282 } |
1282 | 1283 |
1283 sc = qs->connection; | 1284 sc = qs->connection; |
1284 | 1285 |
1285 wev = sc->write; | 1286 if (ngx_quic_reset_stream(sc, f->error_code) != NGX_OK) { |
1286 wev->error = 1; | 1287 pool = sc->pool; |
1287 wev->ready = 1; | 1288 |
1289 ngx_close_connection(sc); | |
1290 ngx_destroy_pool(pool); | |
1291 | |
1292 return NGX_ERROR; | |
1293 } | |
1288 | 1294 |
1289 return ngx_quic_init_stream(qs); | 1295 return ngx_quic_init_stream(qs); |
1290 } | 1296 } |
1291 | 1297 |
1298 if (ngx_quic_reset_stream(qs->connection, f->error_code) != NGX_OK) { | |
1299 return NGX_ERROR; | |
1300 } | |
1301 | |
1292 wev = qs->connection->write; | 1302 wev = qs->connection->write; |
1293 wev->error = 1; | |
1294 wev->ready = 1; | |
1295 | 1303 |
1296 if (wev->active) { | 1304 if (wev->active) { |
1297 wev->handler(wev); | 1305 wev->handler(wev); |
1298 } | 1306 } |
1299 | 1307 |