Mercurial > hg > nginx
annotate src/event/quic/ngx_event_quic_frames.h @ 9250:55a5a40dccde
Reordered checks for Content-Length and Transfer-Encoding.
This ensures that r->headers_in.content_length_n is not set when both
Content-Length and Transfer-Encoding headers are present, making it slightly
safer to use complex processing for 400 (Bad Request) errors.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 27 Apr 2024 18:16:27 +0300 |
parents | 3c98fa8fef6f |
children |
rev | line source |
---|---|
8749
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 |
8948
19e063e955bf
QUIC: renamed buffer-related functions.
Roman Arutyunyan <arut@nginx.com>
parents:
8947
diff
changeset
|
26 ngx_chain_t *ngx_quic_alloc_chain(ngx_connection_t *c); |
19e063e955bf
QUIC: renamed buffer-related functions.
Roman Arutyunyan <arut@nginx.com>
parents:
8947
diff
changeset
|
27 void ngx_quic_free_chain(ngx_connection_t *c, ngx_chain_t *in); |
9011
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
28 |
9071
3c98fa8fef6f
QUIC: ngx_quic_copy_buffer() function.
Roman Arutyunyan <arut@nginx.com>
parents:
9013
diff
changeset
|
29 ngx_chain_t *ngx_quic_copy_buffer(ngx_connection_t *c, u_char *data, |
3c98fa8fef6f
QUIC: ngx_quic_copy_buffer() function.
Roman Arutyunyan <arut@nginx.com>
parents:
9013
diff
changeset
|
30 size_t len); |
9011
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
31 ngx_chain_t *ngx_quic_read_buffer(ngx_connection_t *c, ngx_quic_buffer_t *qb, |
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
32 uint64_t limit); |
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
33 ngx_chain_t *ngx_quic_write_buffer(ngx_connection_t *c, ngx_quic_buffer_t *qb, |
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
34 ngx_chain_t *in, uint64_t limit, uint64_t offset); |
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
35 void ngx_quic_skip_buffer(ngx_connection_t *c, ngx_quic_buffer_t *qb, |
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
36 uint64_t offset); |
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
8967
diff
changeset
|
37 void ngx_quic_free_buffer(ngx_connection_t *c, ngx_quic_buffer_t *qb); |
8749
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
38 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
39 #if (NGX_DEBUG) |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
40 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
|
41 #else |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
42 #define ngx_quic_log_frame(log, f, tx) |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
43 #endif |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
44 |
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
45 #endif /* _NGX_EVENT_QUIC_FRAMES_H_INCLUDED_ */ |