# HG changeset patch # User Roman Arutyunyan # Date 1584981729 -10800 # Node ID c87a13514abcfe09ac07d931538d087b8c3d7f46 # Parent c9c3a73df6e8a59781b943f518910a5c5a1761e0 Allow ngx_queue_frame() to insert frame in the front. Previously a frame could only be inserted after the first element of the list. diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -1142,21 +1142,16 @@ ngx_quic_handle_stream_data_blocked_fram static void 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) { - qc->frames = frame; - return; - } - - for (f = qc->frames; f->next; f = f->next) { - if (f->next->level > frame->level) { + for (f = &qc->frames; *f; f = &(*f)->next) { + if ((*f)->level > frame->level) { break; } } - frame->next = f->next; - f->next = frame; + frame->next = *f; + *f = frame; }