summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-09-29Fixed mismerge of ssl_reject_handshake in 71b7453fb11f.Sergey Kandaurov1-10/+11
In particular, this fixes rejecting "listen .. quic|http3" configurations without TLSv1.3 configured.
2021-09-27HTTP/3: fixed server push after ea9b645472b5.Sergey Kandaurov1-1/+1
Unlike in HTTP/2, both "host" and ":authority" reside in r->headers_in.server.
2021-09-27QUIC: moved a variable initialization near to its use.Sergey Kandaurov1-2/+2
This tends to produce slightly more optimal code with pos == NULL when built with Clang on low optimization levels. Spotted by Ruslan Ermilov.
2021-09-27Configure: fixed QUIC support test.Ruslan Ermilov1-23/+22
OpenSSL library QUIC support cannot be tested at configure time when using the --with-openssl option so assume it's present if requested. While here, fixed the error message in case QUIC support is missing.
2021-09-27Configure: check for QUIC 0-RTT support at compile time.Ruslan Ermilov2-10/+1
2021-09-22HTTP/3: fixed null pointer dereference with server push.Sergey Kandaurov1-0/+4
See details for HTTP/2 fix in 8b0553239592 for a complete description.
2021-09-22HTTP/3: fixed ngx_stat_active counter.Roman Arutyunyan2-0/+8
Previously the counter was not incremented for HTTP/3 streams, but still decremented in ngx_http_close_connection(). There are two solutions here, one is to increment the counter for HTTP/3 streams, and the other one is not to decrement the counter for HTTP/3 streams. The latter solution looks inconsistent with ngx_stat_reading/ngx_stat_writing, which are incremented on a per-request basis. The change adds ngx_stat_active increment for HTTP/3 request and push streams.
2021-09-17HTTP/3: fixed pushed request finalization in case of error.Roman Arutyunyan1-32/+23
Previously request could be finalized twice. For example, this could happen if "Host" header was invalid.
2021-09-22QUIC: set NGX_TCP_NODELAY_DISABLED for fake stream connections.Sergey Kandaurov2-3/+1
Notably, it is to avoid setting the TCP_NODELAY flag for QUIC streams in ngx_http_upstream_send_response(). It is an invalid operation on inherently SOCK_DGRAM sockets, which leads to QUIC connection close. The change reduces diff to the default branch in stream content phase.
2021-09-21QUIC: simplified stream fd initialization.Roman Arutyunyan1-2/+1
2021-09-21Configure: USE_OPENSSL_QUIC=YES implies USE_OPENSSL=YES.Ruslan Ermilov1-1/+1
2021-09-21Configure: ordered directories.Ruslan Ermilov1-2/+2
2021-09-21Configure: simplified condition.Ruslan Ermilov1-3/+0
2021-09-17HTTP/3: make ngx_http_log_error() static again.Roman Arutyunyan3-3/+3
This function was only referenced from ngx_http_v3_create_push_request() to initialize push connection log. Now the log handler is copied from the parent request connection. The change reduces diff to the default branch.
2021-09-09QUIC: separate event handling functions.Roman Arutyunyan3-25/+37
The functions ngx_quic_handle_read_event() and ngx_quic_handle_write_event() are added. Previously this code was a part of ngx_handle_read_event() and ngx_handle_write_event(). The change simplifies ngx_handle_read_event() and ngx_handle_write_event() by moving QUIC-related code to a QUIC source file.
2021-09-16HTTP/3: added CONNECT and TRACE methods rejection.Sergey Kandaurov1-1/+14
It has got lost in e1eb7f4ca9f1, let alone a subsequent update in 63c66b7cc07c.
2021-09-14Removed NGX_OPENSSL_QUIC macro, NGX_QUIC is enough.Ruslan Ermilov3-5/+3
2021-09-13HTTP/3: added debug logging of response fields.Sergey Kandaurov1-3/+38
Because of QPACK compression it's hard to see what fields are actually sent by the server.
2021-09-13HTTP/3: Huffman encoding for the Location response field.Sergey Kandaurov1-59/+55
2021-09-13HTTP/3: Huffman encoding for the Last-Modified response field.Sergey Kandaurov1-4/+11
2021-09-13HTTP/3: Huffman encoding for the Content-Type response field.Sergey Kandaurov1-20/+20
2021-09-13HTTP/3: implemented QPACK Huffman encoding for response fields.Sergey Kandaurov1-5/+82
2021-09-09HTTP/3: reading body buffering in filters.Roman Arutyunyan1-3/+35
This change follows similar changes in HTTP/1 and HTTP/2 in 9cf043a5d9ca.
2021-09-09QUIC: removed Firefox workaround for trailing zeroes in datagrams.Sergey Kandaurov1-5/+0
This became unnecessary after discarding invalid packets since a6784cf32c13.
2021-09-09QUIC: macro style.Ruslan Ermilov1-1/+1
2021-09-09Changed the OpenSSL QUIC support detection.Ruslan Ermilov1-1/+1
As was changed in 253cf267f95a.
2021-09-08Merged with the default branch.Sergey Kandaurov4-56/+58
2021-09-07release-1.21.3 tagMaxim Dounin1-0/+1
2021-09-07nginx-1.21.3-RELEASErelease-1.21.3Maxim Dounin1-0/+27
2021-09-06QUIC: store QUIC connection fd in stream fake connection.Roman Arutyunyan2-6/+8
Previously it had -1 as fd. This fixes proxying, which relies on downstream connection having a real fd. Also, this reduces diff to the default branch for ngx_close_connection().
2021-09-06HTTP/2: optimized processing of small DATA frames.Maxim Dounin1-54/+12
The request body filter chain is no longer called after processing a DATA frame. Instead, we now post a read event to do this. This ensures that multiple small DATA frames read during the same event loop iteration are coalesced together, resulting in much faster processing. Since rb->buf can now contain unprocessed data, window update is no longer sent in ngx_http_v2_state_read_data() in case of flow control being used due to filter buffering. Instead, window will be updated by ngx_http_v2_read_client_request_body_handler() in the posted read event.
2021-09-06HTTP/2: fixed timers left after request body reading.Maxim Dounin1-12/+12
Following rb->filter_need_buffering changes, request body reading is only finished after the filter chain is called and rb->last_saved is set. As such, with r->request_body_no_buffering, timer on fc->read is no longer removed when the last part of the body is received, potentially resulting in incorrect behaviour. The fix is to call ngx_http_v2_process_request_body() from the ngx_http_v2_read_unbuffered_request_body() function instead of directly calling ngx_http_v2_filter_request_body(), so the timer is properly removed.
2021-09-06HTTP/2: fixed window updates when buffering in filters.Maxim Dounin1-2/+18
In the body read handler, the window was incorrectly calculated based on the full buffer size instead of the amount of free space in the buffer. If the request body is buffered by a filter, and the buffer is not empty after the read event is generated by the filter to resume request body processing, this could result in "http2 negative window update" alerts. Further, in the body ready handler and in ngx_http_v2_state_read_data() the buffer wasn't cleared when the data were already written to disk, so the client might stuck without window updates.
2021-09-03QUIC: fixed null pointer dereference in MAX_DATA handler.Mariano Di Martino1-1/+3
If a MAX_DATA frame was received before any stream was created, then the worker process would crash in nginx_quic_handle_max_data_frame() while traversing the stream tree. The issue is solved by adding a check that makes sure the tree is not empty.
2021-09-02Fixed debug logging.Roman Arutyunyan1-2/+2
2021-09-03Version bump.Roman Arutyunyan1-2/+2
2021-09-01README: HTTP/3 trailers are now supported.Sergey Kandaurov1-1/+0
2021-09-01Merged with the default branch.Sergey Kandaurov22-226/+650
2021-08-31release-1.21.2 tagMaxim Dounin1-0/+1
2021-08-31nginx-1.21.2-RELEASErelease-1.21.2Maxim Dounin1-0/+107
2021-08-31Updated OpenSSL used for win32 builds.Maxim Dounin1-1/+1
2021-08-31HTTP/2: avoid memcpy() with NULL source and zero length.Maxim Dounin1-1/+3
Prodded by Clang Static Analyzer.
2021-08-30Give GCC atomics precedence over deprecated Darwin atomic(3).Sergey Kandaurov1-33/+33
This allows to build nginx on macOS with -Wdeprecated-declarations.
2021-08-29Request body: reading body buffering in filters.Maxim Dounin3-26/+182
If a filter wants to buffer the request body during reading (for example, to check an external scanner), it can now do so. To make it possible, the code now checks rb->last_saved (introduced in the previous change) along with rb->rest == 0. Since in HTTP/2 this requires flow control to avoid overflowing the request body buffer, so filters which need buffering have to set the rb->filter_need_buffering flag on the first filter call. (Note that each filter is expected to call the next filter, so all filters will be able set the flag if needed.)
2021-08-29Request body: introduced rb->last_saved flag.Maxim Dounin2-15/+54
It indicates that the last buffer was received by the save filter, and can be used to check this at higher levels. To be used in the following changes.
2021-08-29Request body: added alert to catch duplicate body saving.Maxim Dounin1-0/+6
If due to an error ngx_http_request_body_save_filter() is called more than once with rb->rest == 0, this used to result in a segmentation fault. Added an alert to catch such errors, just in case.
2021-08-29Request body: missing comments about initialization.Maxim Dounin1-0/+2
2021-08-29HTTP/2: improved handling of preread unbuffered requests.Maxim Dounin1-1/+1
Previously, fully preread unbuffered requests larger than client body buffer size were saved to disk, despite the fact that "unbuffered" is expected to imply no disk buffering.
2021-08-29HTTP/2: improved handling of END_STREAM in a separate DATA frame.Maxim Dounin1-0/+3
The save body filter saves the request body to disk once the buffer is full. Yet in HTTP/2 this might happen even if there is no need to save anything to disk, notably when content length is known and the END_STREAM flag is sent in a separate empty DATA frame. Workaround is to provide additional byte in the buffer, so saving the request body won't be triggered. This fixes unexpected request body disk buffering in HTTP/2 observed after the previous change when content length is known and the END_STREAM flag is sent in a separate empty DATA frame.
2021-08-29HTTP/2: reworked body reading to better match HTTP/1.x code.Maxim Dounin1-62/+96
In particular, now the code always uses a buffer limited by client_body_buffer_size. At the cost of an additional copy it ensures that small DATA frames are not directly mapped to small write() syscalls, but rather buffered in memory before writing. Further, requests without Content-Length are no longer forced to use temporary files.