diff options
| author | Roman Arutyunyan <arut@nginx.com> | 2021-12-24 18:17:23 +0300 |
|---|---|---|
| committer | Roman Arutyunyan <arut@nginx.com> | 2021-12-24 18:17:23 +0300 |
| commit | baea97bc543d68ea2cc3a5dc96363777204f99bd (patch) | |
| tree | a12ae66050d66a98d867bbcadf2853b61fa7c01c /src/event/quic/ngx_event_quic_frames.h | |
| parent | 97b34a01e268b2d4946375b806b7e6364e765d70 (diff) | |
| download | nginx-baea97bc543d68ea2cc3a5dc96363777204f99bd.tar.gz nginx-baea97bc543d68ea2cc3a5dc96363777204f99bd.tar.bz2 | |
QUIC: refactored ngx_quic_order_bufs() and ngx_quic_split_bufs().
They are replaced with ngx_quic_write_chain() and ngx_quic_read_chain().
These functions represent the API to data buffering.
The first function adds data of given size at given offset to the buffer.
Now it returns the unwritten part of the chain similar to c->send_chain().
The second function returns data of given size from the beginning of the buffer.
Its second argument and return value are swapped compared to
ngx_quic_split_bufs() to better match ngx_quic_write_chain().
Added, returned and stored data are regular ngx_chain_t/ngx_buf_t chains.
Missing data is marked with b->sync flag.
The functions are now used in both send and recv data chains in QUIC streams.
Diffstat (limited to 'src/event/quic/ngx_event_quic_frames.h')
| -rw-r--r-- | src/event/quic/ngx_event_quic_frames.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/event/quic/ngx_event_quic_frames.h b/src/event/quic/ngx_event_quic_frames.h index 1310f6dfd..19a5c1668 100644 --- a/src/event/quic/ngx_event_quic_frames.h +++ b/src/event/quic/ngx_event_quic_frames.h @@ -30,7 +30,9 @@ ngx_chain_t *ngx_quic_copy_chain(ngx_connection_t *c, ngx_chain_t *in, size_t limit); void ngx_quic_trim_bufs(ngx_chain_t *in, size_t size); void ngx_quic_free_bufs(ngx_connection_t *c, ngx_chain_t *in); -ngx_int_t ngx_quic_order_bufs(ngx_connection_t *c, ngx_chain_t **out, +ngx_chain_t *ngx_quic_read_chain(ngx_connection_t *c, ngx_chain_t **chain, + off_t limit); +ngx_chain_t *ngx_quic_write_chain(ngx_connection_t *c, ngx_chain_t **chain, ngx_chain_t *in, off_t limit, off_t offset); #if (NGX_DEBUG) |
