summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-09-08Merged with the default branch.Sergey Kandaurov1-2/+2
2021-09-06QUIC: store QUIC connection fd in stream fake connection.Roman Arutyunyan1-6/+6
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-03Version bump.Roman Arutyunyan1-2/+2
2021-09-01Merged with the default branch.Sergey Kandaurov1-2/+2
2021-08-03Version bump.Maxim Dounin1-2/+2
2021-07-15Merged with the default branch.Sergey Kandaurov5-32/+49
2021-06-28Core: escaping of chars not allowed in URIs per RFC 3986.Maxim Dounin1-16/+29
Per RFC 3986 only the following characters are allowed in URIs unescaped: unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" And "%" can appear as a part of escaping itself. The following characters are not allowed and need to be escaped: %00-%1F, %7F-%FF, " ", """, "<", ">", "\", "^", "`", "{", "|", "}". Not escaping ">" is known to cause problems at least with MS Exchange (see http://nginx.org/pipermail/nginx-ru/2010-January/031261.html) and in Tomcat (ticket #2191). The patch adds escaping of the following chars in all URI parts: """, "<", ">", "\", "^", "`", "{", "|", "}". Note that comments are mostly preserved to outline important characters being escaped.
2021-06-28Core: fixed comment about escaping in arguments.Maxim Dounin1-1/+1
After 4954530db2af, the ";" character is escaped by ngx_escape_uri(NGX_ESCAPE_ARGS).
2021-06-21Core: added the ngx_rbtree_data() macro.Vladimir Homutov2-3/+4
2021-05-31Core: disabled SO_REUSEADDR on UDP sockets while testing config.Maxim Dounin1-11/+14
On Linux, SO_REUSEADDR allows completely duplicate UDP sockets, so using SO_REUSEADDR when testing configuration results in packets being dropped if there is an existing traffic on the sockets being tested (ticket #2187). While dropped packets are expected with UDP, it is better to avoid this when possible. With this change, SO_REUSEADDR is no longer set on datagram sockets when testing configuration.
2021-05-31Version bump.Maxim Dounin1-2/+2
2021-05-28Merged with the default branch.Sergey Kandaurov3-21/+30
2021-05-25Resolver: explicit check for compression pointers in question.Maxim Dounin1-0/+6
Since nginx always uses exactly one entry in the question section of a DNS query, and never uses compression pointers in this entry, parsing of a DNS response in ngx_resolver_process_response() does not expect compression pointers to appear in the question section of the DNS response. Indeed, compression pointers in the first name of a DNS response hardly make sense, do not seem to be allowed by RFC 1035 (which says "a pointer to a prior occurance of the same name", note "prior"), and were never observed in practice. Added an explicit check to ngx_resolver_process_response()'s parsing of the question section to properly report an error if compression pointers nevertheless appear in the question section.
2021-05-25Resolver: simplified ngx_resolver_copy().Maxim Dounin1-8/+5
Instead of checking on each label if we need to place a dot or not, now it always adds a dot after a label, and reduces the resulting length afterwards.
2021-05-25Resolver: reworked ngx_resolver_copy() copy loop.Maxim Dounin1-11/+7
To make the code easier to read, reworked the ngx_resolver_copy() copy loop to match the one used to calculate length. No functional changes.
2021-05-25Resolver: fixed label types handling in ngx_resolver_copy().Maxim Dounin1-0/+5
Previously, anything with any of the two high bits set were interpreted as compression pointers. This is incorrect, as RFC 1035 clearly states that "The 10 and 01 combinations are reserved for future use". Further, the 01 combination is actually allocated for EDNS extended label type (see RFC 2671 and RFC 6891), not really used though. Fix is to reject unrecognized label types rather than misinterpreting them as compression pointers.
2021-05-25Resolver: fixed off-by-one read in ngx_resolver_copy().Maxim Dounin1-0/+5
It is believed to be harmless, and in the worst case it uses some uninitialized memory as a part of the compression pointer length, eventually leading to the "name is out of DNS response" error.
2021-05-25Resolver: fixed off-by-one write in ngx_resolver_copy().Maxim Dounin1-4/+4
Reported by Luis Merino, Markus Vervier, Eric Sesterhenn, X41 D-Sec GmbH.
2021-05-19Core: fixed comment about msie_refresh escaping.Ruslan Ermilov1-1/+1
After 12a656452ad1, the "%" character is no longer escaped by ngx_escape_uri(NGX_ESCAPE_REFRESH).
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