Mercurial > hg > nginx-quic
annotate src/event/quic/ngx_event_quic_frames.h @ 8801:000b9b048e0c quic
QUIC: fixed chain returned from ngx_quic_write_chain().
Previously, when input ended on a QUIC buffer boundary, input chain was not
advanced to the next buffer. As a result, ngx_quic_write_chain() returned
a chain with an empty buffer instead of NULL. This broke HTTP write filter,
preventing it from closing the HTTP request and eventually timing out.
Now input chain is always advanced to a buffer that has data, before checking
QUIC buffer boundary condition.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 25 Jan 2022 09:45:50 +0300 |
parents | 3789f4a56d65 |
children | f9c788f3f5cc |
rev | line source |
---|---|
8409
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
1 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
2 /* |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
3 * Copyright (C) Nginx, Inc. |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
4 */ |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
5 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
6 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
7 #ifndef _NGX_EVENT_QUIC_FRAMES_H_INCLUDED_ |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
8 #define _NGX_EVENT_QUIC_FRAMES_H_INCLUDED_ |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
9 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
10 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
11 #include <ngx_config.h> |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
12 #include <ngx_core.h> |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
13 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
14 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
15 typedef ngx_int_t (*ngx_quic_frame_handler_pt)(ngx_connection_t *c, |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
16 ngx_quic_frame_t *frame, void *data); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
17 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
18 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
19 ngx_quic_frame_t *ngx_quic_alloc_frame(ngx_connection_t *c); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
20 void ngx_quic_free_frame(ngx_connection_t *c, ngx_quic_frame_t *frame); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
21 void ngx_quic_free_frames(ngx_connection_t *c, ngx_queue_t *frames); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
22 void ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
23 ngx_int_t ngx_quic_split_frame(ngx_connection_t *c, ngx_quic_frame_t *f, |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
24 size_t len); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
25 |
8761
19e063e955bf
QUIC: renamed buffer-related functions.
Roman Arutyunyan <arut@nginx.com>
parents:
8760
diff
changeset
|
26 ngx_chain_t *ngx_quic_alloc_chain(ngx_connection_t *c); |
8409
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
27 ngx_chain_t *ngx_quic_copy_buf(ngx_connection_t *c, u_char *data, |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
28 size_t len); |
8761
19e063e955bf
QUIC: renamed buffer-related functions.
Roman Arutyunyan <arut@nginx.com>
parents:
8760
diff
changeset
|
29 void ngx_quic_trim_chain(ngx_chain_t *in, size_t size); |
19e063e955bf
QUIC: renamed buffer-related functions.
Roman Arutyunyan <arut@nginx.com>
parents:
8760
diff
changeset
|
30 void ngx_quic_free_chain(ngx_connection_t *c, ngx_chain_t *in); |
8760
6ccf3867959a
QUIC: refactored ngx_quic_order_bufs() and ngx_quic_split_bufs().
Roman Arutyunyan <arut@nginx.com>
parents:
8759
diff
changeset
|
31 ngx_chain_t *ngx_quic_read_chain(ngx_connection_t *c, ngx_chain_t **chain, |
6ccf3867959a
QUIC: refactored ngx_quic_order_bufs() and ngx_quic_split_bufs().
Roman Arutyunyan <arut@nginx.com>
parents:
8759
diff
changeset
|
32 off_t limit); |
6ccf3867959a
QUIC: refactored ngx_quic_order_bufs() and ngx_quic_split_bufs().
Roman Arutyunyan <arut@nginx.com>
parents:
8759
diff
changeset
|
33 ngx_chain_t *ngx_quic_write_chain(ngx_connection_t *c, ngx_chain_t **chain, |
8793
3789f4a56d65
QUIC: return written size from ngx_quic_write_chain().
Roman Arutyunyan <arut@nginx.com>
parents:
8762
diff
changeset
|
34 ngx_chain_t *in, off_t limit, off_t offset, size_t *size); |
8409
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
35 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
36 #if (NGX_DEBUG) |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
37 void ngx_quic_log_frame(ngx_log_t *log, ngx_quic_frame_t *f, ngx_uint_t tx); |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
38 #else |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
39 #define ngx_quic_log_frame(log, f, tx) |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
40 #endif |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
41 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
42 #endif /* _NGX_EVENT_QUIC_FRAMES_H_INCLUDED_ */ |