comparison src/event/quic/ngx_event_quic_streams.c @ 9050:aaca8e111959 quic

QUIC: post close event for connection close. Previously, close event was used only for close timeout, while read event was used for posting connection close.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 07 Sep 2022 19:25:13 +0400
parents c6580dce98a8
children 37d5dddabaea
comparison
equal deleted inserted replaced
9049:2b4891fa0fbc 9050:aaca8e111959
1029 ngx_rbtree_delete(&qc->streams.tree, &qs->node); 1029 ngx_rbtree_delete(&qc->streams.tree, &qs->node);
1030 ngx_queue_insert_tail(&qc->streams.free, &qs->queue); 1030 ngx_queue_insert_tail(&qc->streams.free, &qs->queue);
1031 1031
1032 if (qc->closing) { 1032 if (qc->closing) {
1033 /* schedule handler call to continue ngx_quic_close_connection() */ 1033 /* schedule handler call to continue ngx_quic_close_connection() */
1034 ngx_post_event(pc->read, &ngx_posted_events); 1034 ngx_post_event(&qc->close, &ngx_posted_events);
1035 return NGX_OK; 1035 return NGX_OK;
1036 } 1036 }
1037 1037
1038 if ((qs->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0) { 1038 if ((qs->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0) {
1039 frame = ngx_quic_alloc_frame(pc); 1039 frame = ngx_quic_alloc_frame(pc);
1055 1055
1056 ngx_quic_queue_frame(qc, frame); 1056 ngx_quic_queue_frame(qc, frame);
1057 } 1057 }
1058 1058
1059 if (qc->shutdown) { 1059 if (qc->shutdown) {
1060 ngx_post_event(pc->read, &ngx_posted_events); 1060 ngx_post_event(&qc->close, &ngx_posted_events);
1061 } 1061 }
1062 1062
1063 return NGX_OK; 1063 return NGX_OK;
1064 } 1064 }
1065 1065