Allow ngx_queue_frame() to insert frame in the front.

Previously a frame could only be inserted after the first element of the list.
This commit is contained in:
Roman Arutyunyan 2020-03-23 19:42:09 +03:00
parent ede2656c60
commit 9975b088bb

View File

@ -1142,21 +1142,16 @@ ngx_quic_handle_stream_data_blocked_frame(ngx_connection_t *c,
static void static void
ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame) ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame)
{ {
ngx_quic_frame_t *f; ngx_quic_frame_t **f;
if (qc->frames == NULL) { for (f = &qc->frames; *f; f = &(*f)->next) {
qc->frames = frame; if ((*f)->level > frame->level) {
return;
}
for (f = qc->frames; f->next; f = f->next) {
if (f->next->level > frame->level) {
break; break;
} }
} }
frame->next = f->next; frame->next = *f;
f->next = frame; *f = frame;
} }