diff options
author | Roman Arutyunyan <arut@nginx.com> | 2022-02-17 22:38:42 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2022-02-17 22:38:42 +0300 |
commit | c24c27bb074b571fc9e9d75e19be31b83c69c253 (patch) | |
tree | 8e53c741d79bf65af955072adf21cf5fd617f796 /src/event/quic/ngx_event_quic_frames.c | |
parent | 2526632f7172d46d54dbf9738b497d91b9543f50 (diff) | |
download | nginx-c24c27bb074b571fc9e9d75e19be31b83c69c253.tar.gz nginx-c24c27bb074b571fc9e9d75e19be31b83c69c253.zip |
QUIC: fixed insertion at the end of buffer.
Previously, last buffer was tracked by keeping a pointer to the previous
chain link "next" field. When the previous buffer was split and then removed,
the pointer was no longer valid. Writing at this pointer resulted in broken
data chains.
Now last buffer is tracked by keeping a direct pointer to it.
Diffstat (limited to 'src/event/quic/ngx_event_quic_frames.c')
-rw-r--r-- | src/event/quic/ngx_event_quic_frames.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event/quic/ngx_event_quic_frames.c b/src/event/quic/ngx_event_quic_frames.c index 5ffae32c3..9a1a6afe5 100644 --- a/src/event/quic/ngx_event_quic_frames.c +++ b/src/event/quic/ngx_event_quic_frames.c @@ -503,7 +503,7 @@ ngx_quic_write_buffer(ngx_connection_t *c, ngx_quic_buffer_t *qb, if (qb->last_chain && offset >= qb->last_offset) { base = qb->last_offset; - chain = qb->last_chain; + chain = &qb->last_chain; } else { base = qb->offset; @@ -600,7 +600,7 @@ ngx_quic_write_buffer(ngx_connection_t *c, ngx_quic_buffer_t *qb, } qb->last_offset = base; - qb->last_chain = chain; + qb->last_chain = *chain; return in; } |