aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Stream: upstream response time variables.Vladimir Homutov2016-09-02
| | | | | The $upstream_connect_time, $upstream_first_byte_time and $upstream_session_time variables keep corresponding times.
* Stream: $upstream_bytes_sent and $upstream_bytes_received.Vladimir Homutov2016-09-02
|
* Stream: the $upstream_addr variable.Vladimir Homutov2016-09-02
| | | | | | Keeps the full address of the upstream server. If several servers were contacted during proxying, their addresses are separated by commas, e.g. "192.168.1.1:80, 192.168.1.2:80".
* Stream: the $status variable.Roman Arutyunyan2016-08-11
| | | | | | | | | | The stream session status is one of the following: 200 - normal completion 403 - access forbidden 500 - internal server error 502 - bad gateway 503 - limit conn
* Event pipe: do not set file's thread_handler if not needed.Maxim Dounin2016-09-01
| | | | | | | | | | | | | | | | | This fixes a problem with aio threads and sendfile with aio_write switched off, as observed with range requests after fc72784b1f52 (1.9.13). Potential problems with sendfile in threads were previously described in 9fd738b85fad, and this seems to be one of them. The problem occurred as file's thread_handler was set to NULL by event pipe code after a sendfile thread task was scheduled. As a result, no sendfile completion code was executed, and the same buffer was additionally sent using non-threaded sendfile. Fix is to avoid modifying file's thread_handler if aio_write is switched off. Note that with "aio_write on" it is still possible that sendfile will use thread_handler as set by event pipe. This is believed to be safe though, as handlers used are compatible.
* Event pipe: process data after recv_chain() errors.Maxim Dounin2016-09-01
| | | | | | | | | | | | | When c->recv_chain() returns an error, it is possible that we already have some data previously read, e.g., in preread buffer. And in some cases it may be even a complete response. Changed c->recv_chain() error handling to process the data, much like it is already done if kevent reports about an error. This change, in particular, fixes processing of small responses when an upstream fails to properly close a connection with lingering and therefore the connection is reset, but the response is already fully obtained by nginx (see ticket #1037).
* Realip: fixed uninitialized memory access.Roman Arutyunyan2016-09-01
| | | | | | Previously, the realip module could be left with uninitialized context after an error in the ngx_http_realip_set_addr() function. That context could be later accessed by $realip_remote_addr and $realip_remote_port variable handlers.
* Stream: the $protocol variable.Vladimir Homutov2016-08-26
| | | | The variable keeps protocol used by the client, "TCP" or "UDP".
* Stream: the $session_time variable.Vladimir Homutov2016-08-26
| | | | The variable keeps time spent on processing the stream session.
* Stream: the $bytes_received variable.Vladimir Homutov2016-08-26
| | | | The variable keeps the number of bytes received from the client.
* Thread pools: create threads in detached state.Piotr Sikora2016-08-15
| | | | | | | | This prevents theoretical resource leak, since those threads are never joined. Found with ThreadSanitizer. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Geo: fixed indentation.Sergey Kandaurov2016-08-25
|
* Geo: fixed warnings when removing nonexistent ranges.Ruslan Ermilov2016-08-23
| | | | | | | | | | | | | geo $geo { ranges; 10.0.0.0-10.0.0.255 test; delete 10.0.1.0-10.0.1.255; # should warn delete 10.0.0.0-10.0.0.255; delete 10.0.0.0-10.0.0.255; # should warn }
* Geo: fixed insertion of ranges specified in descending order.Ruslan Ermilov2016-08-23
|
* Geo: fixed removing a range in certain cases.Ruslan Ermilov2016-08-23
| | | | | | If the range includes two or more /16 networks and does not start at the /16 boundary, the last subrange was not removed (see 91cff7f97a50 for details).
* Geo: fixed overflow when iterating over ranges.Ruslan Ermilov2016-08-23
|
* SSL: adopted session ticket handling for OpenSSL 1.1.0.Sergey Kandaurov2016-08-22
| | | | | | | | | Return 1 in the SSL_CTX_set_tlsext_ticket_key_cb() callback function to indicate that a new session ticket is created, as per documentation. Until 1.1.0, OpenSSL didn't make a distinction between non-negative return values. See https://git.openssl.org/?p=openssl.git;a=commitdiff;h=5c753de for details.
* SSL: remove no longer needed workaround for BoringSSL.Piotr Sikora2016-08-18
| | | | | | | | BoringSSL added a no-op stub for OPENSSL_config() on 2016-01-26. Requested by David Benjamin. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Events: fixed setting of IP_BIND_ADDRESS_NO_PORT/SO_REUSEADDR.Ruslan Ermilov2016-08-22
| | | | | | | | | The IP_BIND_ADDRESS_NO_PORT option is set on upstream sockets if proxy_bind does not specify a port. The SO_REUSEADDR option is set on UDP upstream sockets if proxy_bind specifies a port. Due to checking of the wrong port, IP_BIND_ADDRESS_NO_PORT was never set, and SO_REUSEPORT was always set.
* Ensure "listen" exists in a mail or stream server (ticket #1049).Roman Arutyunyan2016-08-17
|
* Fixed wrong type of the "line" field.Roman Arutyunyan2016-08-18
| | | | The new type ngx_uint_t was supposed when formatting the line number.
* Geo: fixed access to already freed memory.Valentin Bartenev2016-08-18
| | | | | Previously, in "ranges" mode when all added ranges were deleted, the ctx.high.low[i] was left pointing to a temporary array.
* Upstream: the $upstream_bytes_received variable.Vladimir Homutov2016-08-10
| | | | | | Unlike $upstream_response_length that only counts the body size, the new variable also counts the size of response header and data received after switching protocols when proxying WebSockets.
* Simplified extraction of current time.Ruslan Ermilov2016-08-08
|
* SSL: guarded SSL_R_NO_CIPHERS_PASSED not present in OpenSSL 1.1.0.Sergey Kandaurov2016-08-08
| | | | | It was removed in OpenSSL 1.1.0 Beta 3 (pre-release 6). It was not used since OpenSSL 1.0.1n and 1.0.2b.
* Always seed PRNG with PID, seconds, and milliseconds.Ruslan Ermilov2016-08-04
|
* Fixed undefined behavior when left shifting signed integer.Ruslan Ermilov2016-08-04
|
* Win32: added per-thread random seeding.Ruslan Ermilov2016-08-04
| | | | | | | | | The change in b91bcba29351 was not enough to fix random() seeding. On Windows, the srand() seeds the PRNG only in the current thread, and worse, is not inherited from the calling thread. Due to this, worker threads were not properly seeded. Reported by Marc Bevand.
* Stream: fixed build without stream_ssl_module (ticket #1032).Vladimir Homutov2016-07-26
|
* Version bump.Vladimir Homutov2016-07-26
|
* Fixed regex captures handling without PCRE.Vladimir Homutov2016-07-06
| | | | | | | | | | If PCRE is disabled, captures were treated as normal variables in ngx_http_script_compile(), while code calculating flushes array length in ngx_http_compile_complex_value() did not account captures as variables. This could lead to write outside of the array boundary when setting last element to -1. Found with AddressSanitizer.
* Stream: variables in proxy_pass and proxy_ssl_name.Vladimir Homutov2016-06-14
|
* HTTP/2: flushing of the SSL buffer in transition to the idle state.Valentin Bartenev2016-07-19
| | | | | | | It fixes potential connection leak if some unsent data was left in the SSL buffer. Particularly, that could happen when a client canceled the stream after the HEADERS frame has already been created. In this case no other frames might be produced and the HEADERS frame alone didn't flush the buffer.
* HTTP/2: refactored ngx_http_v2_send_output_queue().Valentin Bartenev2016-07-19
| | | | Now it returns NGX_AGAIN if there's still data to be sent.
* HTTP/2: fixed send timer handling.Valentin Bartenev2016-07-19
| | | | | | | | | | Checking for return value of c->send_chain() isn't sufficient since there are data can be left in the SSL buffer. Now the wew->ready flag is used instead. In particular, this fixed a connection leak in cases when all streams were closed, but there's still some data to be sent in the SSL buffer and the client forgot about the connection.
* HTTP/2: avoid sending output queue if there's nothing to send.Valentin Bartenev2016-07-19
| | | | | | | | | Particularly this fixes alerts on OS X and NetBSD systems when HTTP/2 is configured over plain TCP sockets. On these systems calling writev() with no data leads to EINVAL errors being logged as "writev() failed (22: Invalid argument) while processing HTTP/2 connection".
* HTTP/2: always handle streams in error state.Valentin Bartenev2016-07-19
| | | | | Previously, a stream could be closed by timeout if it was canceled while its send window was exhausted.
* HTTP/2: prevented output of the HEADERS frame for canceled streams.Valentin Bartenev2016-07-19
| | | | It's useless to generate HEADERS if the stream has been canceled already.
* HTTP/2: always send GOAWAY while worker is shutting down.Valentin Bartenev2016-07-19
| | | | | Previously, if the worker process exited, GOAWAY was sent to connections in idle state, but connections with active streams were closed without GOAWAY.
* Events: support for EPOLLEXCLUSIVE.Valentin Bartenev2016-07-15
| | | | | | | | | This flag appeared in Linux 4.5 and is useful for avoiding thundering herd problem. The current Linux kernel implementation walks the list of exclusive waiters, and queues an event to each epfd, until it finds the first waiter that has threads blocked on it via epoll_wait().
* Style: sorted epoll flags.Valentin Bartenev2016-07-15
|
* Events: the "accept_mutex" directive is turned off by default.Valentin Bartenev2016-07-15
| | | | | | Now it is believed that the accept mutex brings more harm than benefits. Especially in various benchmarks it often results in situation where only one worker grabs all connections.
* Stream: split_clients module.Vladimir Homutov2016-07-12
|
* Stream: geo module.Vladimir Homutov2016-06-30
|
* Stream: geoip module.Vladimir Homutov2016-07-12
|
* Stream: style.Vladimir Homutov2016-07-12
|
* HTTP/2: avoid left-shifting signed integer into the sign bit.Sergey Kandaurov2016-07-07
| | | | | | | | | | | | | | | On non-aligned platforms, properly cast argument before left-shifting it in ngx_http_v2_parse_uint32 that is used with u_char. Otherwise it propagates to int to hold the value and can step over the sign bit. Usually, on known compilers, this results in negation. Furthermore, a subsequent store into a wider type, that is ngx_uint_t on 64-bit platforms, results in sign-extension. In practice, this can be observed in debug log as a very large exclusive bit value, when client sent PRIORITY frame with exclusive bit set: : *14 http2 PRIORITY frame sid:5 on 1 excl:8589934591 weight:17 Found with UndefinedBehaviorSanitizer.
* Avoid left-shifting integers into the sign bit, which is undefined.Sergey Kandaurov2016-07-07
| | | | Found with UndefinedBehaviorSanitizer.
* Stream: resolver.Vladimir Homutov2016-07-07
|
* Use NGX_MAX_PATH_LEVEL where appropriate.Ruslan Ermilov2016-07-06
| | | | The macro was unused since 0.7.44.