comparison src/event/ngx_event_quic.c @ 8270:c87a13514abc quic

Allow ngx_queue_frame() to insert frame in the front. Previously a frame could only be inserted after the first element of the list.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 23 Mar 2020 19:42:09 +0300
parents a8349cc72c64
children 8e54a17dabee
comparison
equal deleted inserted replaced
8269:c9c3a73df6e8 8270:c87a13514abc
1140 1140
1141 1141
1142 static void 1142 static void
1143 ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame) 1143 ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame)
1144 { 1144 {
1145 ngx_quic_frame_t *f; 1145 ngx_quic_frame_t **f;
1146 1146
1147 if (qc->frames == NULL) { 1147 for (f = &qc->frames; *f; f = &(*f)->next) {
1148 qc->frames = frame; 1148 if ((*f)->level > frame->level) {
1149 return;
1150 }
1151
1152 for (f = qc->frames; f->next; f = f->next) {
1153 if (f->next->level > frame->level) {
1154 break; 1149 break;
1155 } 1150 }
1156 } 1151 }
1157 1152
1158 frame->next = f->next; 1153 frame->next = *f;
1159 f->next = frame; 1154 *f = frame;
1160 } 1155 }
1161 1156
1162 1157
1163 static ngx_int_t 1158 static ngx_int_t
1164 ngx_quic_output(ngx_connection_t *c) 1159 ngx_quic_output(ngx_connection_t *c)