comparison src/event/ngx_event_quic.c @ 8066:97da6521657c quic

QUIC: send STOP_SENDING on stream closure. The frame is sent for a read-enabled stream which has not received a FIN or RESET_STREAM.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 25 Aug 2020 14:07:26 +0300
parents 11fc65261689
children f882b1784f30
comparison
equal deleted inserted replaced
8065:cec7f207a4bf 8066:97da6521657c
4562 /* schedule handler call to continue ngx_quic_close_connection() */ 4562 /* schedule handler call to continue ngx_quic_close_connection() */
4563 ngx_post_event(pc->read, &ngx_posted_events); 4563 ngx_post_event(pc->read, &ngx_posted_events);
4564 return; 4564 return;
4565 } 4565 }
4566 4566
4567 if ((qs->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0
4568 || (qs->id & NGX_QUIC_STREAM_UNIDIRECTIONAL) == 0)
4569 {
4570 if (!c->read->eof && !c->read->error) {
4571 frame = ngx_quic_alloc_frame(pc, 0);
4572 if (frame == NULL) {
4573 return;
4574 }
4575
4576 frame->level = ssl_encryption_application;
4577 frame->type = NGX_QUIC_FT_STOP_SENDING;
4578 frame->u.stop_sending.id = qs->id;
4579 frame->u.stop_sending.error_code = 0x100; /* HTTP/3 no error */
4580
4581 ngx_sprintf(frame->info, "STOP_SENDING id:0x%xL err:0x%xL level:%d",
4582 qs->id, frame->u.stop_sending.error_code, frame->level);
4583
4584 ngx_quic_queue_frame(qc, frame);
4585 }
4586 }
4587
4567 if ((qs->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0) { 4588 if ((qs->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0) {
4568 frame = ngx_quic_alloc_frame(pc, 0); 4589 frame = ngx_quic_alloc_frame(pc, 0);
4569 if (frame == NULL) { 4590 if (frame == NULL) {
4570 return; 4591 return;
4571 } 4592 }