summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-21Version bump.Maxim Dounin1-2/+2
2021-04-08Introduced the "keepalive_time" directive.Maxim Dounin2-0/+5
Similar to lingering_time, it limits total connection lifetime before keepalive is switched off. The default is 1 hour, which is close to the total maximum connection lifetime possible with default keepalive_requests and keepalive_timeout.
2021-04-16Merged with the default branch.Sergey Kandaurov3-2/+7
2021-04-05Version bump.Maxim Dounin1-2/+2
2021-03-28Resolver: added missing event handling after reading.Maxim Dounin1-2/+17
If we need to be notified about further events, ngx_handle_read_event() needs to be called after a read event is processed. Without this, an event can be removed from the kernel and won't be reported again, notably when using oneshot event methods, such as eventport on Solaris. While here, error handling is also added, similar to one present in ngx_resolver_tcp_read(). This is not expected to make a difference and mostly added for consistency.
2021-03-30Merged with the default branch.Sergey Kandaurov2-4/+19
2021-03-23Core: fixed build with BPF on non-64bit platforms (ticket #2152).Vladimir Homutov1-8/+8
2021-03-11Version bump.Maxim Dounin1-2/+2
2021-03-10Merged with the default branch.Sergey Kandaurov1-2/+2
2021-02-20Version bump.Ruslan Ermilov1-2/+2
2021-02-17Merged with the default branch.Sergey Kandaurov3-4/+18
2021-02-11Additional connections reuse.Maxim Dounin1-0/+16
If ngx_drain_connections() fails to immediately reuse any connections and there are no free connections, it now additionally tries to reuse a connection again. This helps to provide at least one free connection in case of HTTP/2 with lingering close, where merely trying to reuse a connection once does not free it, but makes it reusable again, waiting for lingering close.
2021-01-19Core: removed post_accept_timeout.Maxim Dounin1-2/+0
Keeping post_accept_timeout in ngx_listening_t is no longer needed since we've switched to 1 second timeout for deferred accept in 5541:fdb67cfc957d. Further, using it in HTTP code can result in client_header_timeout being used from an incorrect server block, notably if address-specific virtual servers are used along with a wildcard listening socket, or if we've switched to a different server block based on SNI in SSL handshake.
2021-01-11Version bump.Maxim Dounin1-2/+2
2020-12-25QUIC: ngx_quic_bpf module.Vladimir Homutov1-0/+3
The quic kernel bpf helper inspects packet payload for DCID, extracts key and routes the packet into socket matching the key. Due to reuseport feature, each worker owns a personal socket, which is identified by the same key, used to create DCID. BPF objects are locked in RAM and are subject to RLIMIT_MEMLOCK. The "ulimit -l" command may be used to setup proper limits, if maps cannot be created with EPERM or updated with ETOOLONG.
2020-12-15Core: added interface to linux bpf() system call.Vladimir Homutov3-0/+189
It contains wrappers for operations with BPF maps and for loading BPF programs.
2020-12-15Merged with the default branch.Sergey Kandaurov1-2/+2
2020-11-26Version bump.Ruslan Ermilov1-2/+2
2020-11-19Core: "-e" command line option.Igor Ippolitov5-16/+56
When installing or running from a non-root user it is sometimes required to override default, compiled in error log path. There was no way to do this without rebuilding the binary (ticket #147). This patch introduced "-e" command line option which allows one to override compiled in error log path.
2020-11-24Merged with the default branch.Sergey Kandaurov7-37/+126
2020-11-13Core: hide "struct ngx_quic_connection_s" and further reduce diffs.Sergey Kandaurov1-19/+18
As with the previous change, it became feasible with feec2cc762f6 that removes ngx_quic_connection_t from ngx_connection_s.
2020-11-13Core: reduced diff to the default branch.Sergey Kandaurov1-4/+4
It became feasible to reduce after feec2cc762f6 that removes ngx_quic_connection_t from ngx_connection_s.
2020-11-10QUIC: renamed c->qs to c->quic.Roman Arutyunyan1-1/+1
2020-11-10QUIC: got rid of the c->quic field.Roman Arutyunyan1-1/+0
Now QUIC connection is accessed via the c->udp field.
2020-10-29Merged with the default branch.Sergey Kandaurov2-3/+3
2020-10-28Core: added format specifiers to output binary data as hex.Vladimir Homutov1-19/+68
Now "s", "V", and "v" format specifiers may be prefixed with "x" (lowercase) or "X" (uppercase) to output corresponding data in hexadecimal format. In collaboration with Maxim Dounin.
2020-11-05Version bump.Vladimir Homutov1-2/+2
2020-10-22Core: ngx_conf_set_keyval_slot() now accepts NGX_CONF_UNSET_PTR.Maxim Dounin1-1/+1
With this change, it is now possible to use ngx_conf_merge_ptr_value() to merge keyval arrays. This change actually follows much earlier changes in ngx_conf_merge_ptr_value() and ngx_conf_set_str_array_slot() in 1452:cd586e963db0 (0.6.10) and 1701:40d004d95d88 (0.6.22). To preserve compatibility with existing 3rd party modules, both NULL and NGX_CONF_UNSET_PTR are accepted for now.
2020-10-03Version bump.Maxim Dounin1-2/+2
2020-09-28Resolver: improved error messages (ticket #2024).Maxim Dounin1-16/+16
2020-10-01Merged with the default branch.Sergey Kandaurov2-18/+18
2020-08-18Merged with the default branch.Roman Arutyunyan5-19/+35
2020-08-10Core: reusing connections in advance.Maxim Dounin1-6/+5
Reworked connections reuse, so closing connections is attempted in advance, as long as number of free connections is less than 1/16 of worker connections configured. This ensures that new connections can be handled even if closing a reusable connection requires some time, for example, for a lingering close (ticket #2017). The 1/16 ratio is selected to be smaller than 1/8 used for disabling accept when working with accept mutex, so nginx will try to balance new connections to different workers first, and will start reusing connections only if this won't help.
2020-08-10Core: added a warning about reusing connections.Maxim Dounin2-0/+14
Previously, reusing connections happened silently and was only visible in monitoring systems. This was shown to be not very user-friendly, and administrators often didn't realize there were too few connections available to withstand the load, and configured timeouts (keepalive_timeout and http2_idle_timeout) were effectively reduced to keep things running. To provide at least some information about this, a warning is now logged (at most once per second, to avoid flooding the logs).
2020-07-27Core: enclosed parameters of the ngx_buf.h macros in parentheses.balus1-10/+10
2020-07-21Core: close PID file when writing fails.Ruslan Ermilov1-2/+5
Reported by Jinhua Tan.
2020-07-22QUIC: fixed bulding perl module by reducing header pollution.Sergey Kandaurov1-2/+0
The ngx_http_perl_module module doesn't have a notion of including additional search paths through --with-cc-opt, which results in compile error incomplete type 'enum ssl_encryption_level_t' when building nginx without QUIC support. The enum is visible from quic event headers and eventually pollutes ngx_core.h. The fix is to limit including headers to compile units that are real consumers.
2020-07-21QUIC: added "quic" listen parameter.Roman Arutyunyan2-1/+6
The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there
2020-07-13Merged with the default branch.Sergey Kandaurov4-3/+6
2020-07-09Version bump.Roman Arutyunyan1-2/+2
2020-06-23Do not close QUIC sockets in ngx_close_listening_sockets().Sergey Kandaurov2-0/+5
This breaks graceful shutdown of QUIC connections in terms of quic-transport.
2020-06-01Fixed removing of listening UNIX sockets when "changing binary".Ruslan Ermilov3-1/+4
When changing binary, sending a SIGTERM to the new binary's master process should not remove inherited UNIX sockets unless the old binary's master process has exited.
2020-05-26Merged with the default branch.Sergey Kandaurov1-2/+2
2020-05-26Version bump.Maxim Dounin1-2/+2
2020-04-30Configure: unbreak with old OpenSSL, --with-http_v3_module added.Sergey Kandaurov1-0/+2
2020-04-23Version bump.Ruslan Ermilov1-2/+2
2020-04-14Merged with the default branch.Sergey Kandaurov1-2/+2
2020-03-18Extracted transport part of the code into separate file.Vladimir Homutov1-0/+1
All code dealing with serializing/deserializing is moved int srv/event/ngx_event_quic_transport.c/h file. All macros for dealing with data are internal to source file. The header file exposes frame types and error codes. The exported functions are currently packet header parsers and writers and frames parser/writer. The ngx_quic_header_t structure is updated with 'log' member. This avoids passing extra argument to parsing functions that need to report errors.
2020-03-16Split transport and crypto parts into separate files.Vladimir Homutov1-0/+1
New files: src/event/ngx_event_quic_protection.h src/event/ngx_event_quic_protection.c The protection.h header provides interface to the crypto part of the QUIC: 2 functions to initialize corresponding secrets: ngx_quic_set_initial_secret() ngx_quic_set_encryption_secret() and 2 functions to deal with packet processing: ngx_quic_encrypt() ngx_quic_decrypt() Also, structures representing secrets are defined there. All functions require SSL connection and a pool, only crypto operations inside, no access to nginx connections or events. Currently pool->log is used for the logging (instead of original c->log).
2020-03-13Fixed sanitizer errors.Roman Arutyunyan1-6/+6