aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Headers filter: style.Piotr Sikora2017-05-31
| | | | Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* HTTP/2: add debug logging of pseudo-headers and cookies.Piotr Sikora2017-05-30
| | | | Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Version bump.Valentin Bartenev2017-05-30
|
* Fixed background requests with asynchronous operations.Roman Arutyunyan2017-05-29
| | | | | | | | | | | | | | | | | | | | | If the main request was finalized while a background request performed an asynchronous operation, the main request ended up in ngx_http_writer() and was not finalized until a network event or a timeout. For example, cache background update with aio enabled made nginx unable to process further client requests or close the connection, keeping it open until client closes it. Now regular finalization of the main request is not suspended because of an asynchronous operation in another request. If a background request was terminated while an asynchronous operation was in progress, background request's write event handler was changed to ngx_http_request_finalizer() and never called again. Now, whenever a request is terminated while an asynchronous operation is in progress, connection error flag is set to make further finalizations of any request with this connection lead to termination. These issues appeared in 1aeaae6e9446 (not yet released).
* Style: changed checks of ngx_ssl_create_connection() to != NGX_OK.Maxim Dounin2017-05-29
| | | | | | In http these checks were changed in a6d6d762c554, though mail module was missed at that time. Since then, the stream module was introduced based on mail, using "== NGX_ERROR" check.
* SSL: set TCP_NODELAY on SSL connections before handshake.Maxim Dounin2017-05-29
| | | | | | | | | | | | With OpenSSL 1.1.0+, the workaround for handshake buffer size as introduced in a720f0b0e083 (ticket #413) no longer works, as OpenSSL no longer exposes handshake buffers, see https://github.com/openssl/openssl/commit/2e7dc7cd688. Moreover, it is no longer possible to adjust handshake buffers at all now. To avoid additional RTT if handshake uses more than 4k we now set TCP_NODELAY on SSL connections before handshake. While this still results in sub-optimal network utilization due to incomplete packets being sent, it seems to be better than nothing.
* Introduced ngx_tcp_nodelay().Ruslan Ermilov2017-05-26
|
* Background subrequests for cache updates.Roman Arutyunyan2017-05-25
| | | | | | | | | | Previously, cache background update might not work as expected, making client wait for it to complete before receiving the final part of a stale response. This could happen if the response could not be sent to the client socket in one filter chain call. Now background cache update is done in a background subrequest. This type of subrequest does not block any other subrequests or the main request.
* Fixed deferred accept with EPOLLRDHUP enabled (ticket #1278).Roman Arutyunyan2017-05-24
| | | | | | | | | | Previously, the read event of the accepted connection was marked ready, but not available. This made EPOLLRDHUP-related code (for example, in ngx_unix_recv()) expect more data from the socket, leading to unexpected behavior. For example, if SSL, PROXY protocol and deferred accept were enabled on a listen socket, the client connection was aborted due to unexpected return value of c->recv().
* HTTP/2: fixed segfault when memory allocation failed.Valentin Bartenev2017-05-23
| | | | | | | | If allocation of cleanup handler in the HTTP/2 header filter failed, then a stream might be freed with a HEADERS frame left in the output queue. Now the HEADERS frame is accounted in the queue before trying to allocate the cleanup handler.
* Cache: ignore long locked entries during forced expire.Dmitry Volyntsev2017-05-18
| | | | | | | | | | Abnormally exited workers may leave locked cache entries, this can result in the cache size on disk exceeding max_size and shared memory exhaustion. This change mitigates the issue by ignoring locked entries during forced expire. It also increases the visibility of the problem by logging such entries.
* Upstream: fixed u->headers_in.headers allocation error handling.Sergey Kandaurov2017-05-18
| | | | | | | Previously, an allocation error resulted in uninitialized memory access when evaluating $upstream_http_ variables. On a related note, see r->headers_out.headers cleanup work in 0cdee26605f3.
* Realip: allow hostnames in set_real_ip_from (ticket #1180).Ruslan Ermilov2017-05-15
|
* Access: simplified rule parser code.Ruslan Ermilov2017-05-15
|
* SSL: allowed renegotiation in client mode with OpenSSL < 1.1.0.Sergey Kandaurov2017-05-03
| | | | | | In ac9b1df5b246 (1.13.0) we attempted to allow renegotiation in client mode, but when using OpenSSL 1.0.2 or older versions it was additionally disabled by SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS.
* Added missing "fall through" comments (ticket #1259).Maxim Dounin2017-04-27
| | | | Found by gcc7 (-Wimplicit-fallthrough).
* Don't pretend we support HTTP major versions >1 as HTTP/1.1.Ruslan Ermilov2017-04-25
|
* Version bump.Ruslan Ermilov2017-04-25
|
* HTTP/2: reduced difference to HTTP/1.x in reading request body.Valentin Bartenev2017-04-24
| | | | | | | Particularly, this eliminates difference in behavior for requests without body and deduplicates code. Prodded by Piotr Sikora.
* HTTP/2: rejecting zero WINDOW_UPDATE with PROTOCOL_ERROR.Valentin Bartenev2017-04-24
| | | | | | | It's required by RFC 7540. While there is no real harm from such frames, that should help to detect broken clients. Based on a patch by Piotr Sikora.
* Gzip static: use an appropriate error on memory allocation failure.Sergey Kandaurov2017-04-20
|
* Cleaned up r->headers_out.headers allocation error handling.Sergey Kandaurov2017-04-20
| | | | | | | | | | If initialization of a header failed for some reason after ngx_list_push(), leaving the header as is can result in uninitialized memory access by the header filter or the log module. The fix is to clear partially initialized headers in case of errors. For the Cache-Control header, the fix is to postpone pushing r->headers_out.cache_control until its value is completed.
* Core: signal sender pid logging.Igor Sysoev2017-04-20
|
* Sub filter: restored ngx_http_set_ctx() at the proper place.Sergey Kandaurov2017-04-18
| | | | | | | | | | | Previously, ngx_http_sub_header_filter() could fail with a partially initialized context, later accessed in ngx_http_sub_body_filter() if called from the perl content handler. The issue had appeared in 2c045e5b8291 (1.9.4). A better fix would be to handle ngx_http_send_header() errors in the perl module, though this doesn't seem to be easy enough.
* SSL: compatibility with OpenSSL master branch.Sergey Kandaurov2017-04-18
| | | | | The SSL_CTRL_SET_CURVES_LIST macro is removed in the OpenSSL master branch. SSL_CTX_set1_curves_list is preserved as compatibility with previous versions.
* SSL: disabled renegotiation detection in client mode.Sergey Kandaurov2017-04-18
| | | | | | | | | | | | | | | | | | CVE-2009-3555 is no longer relevant and mitigated by the renegotiation info extension (secure renegotiation). On the other hand, unexpected renegotiation still introduces potential security risks, and hence we do not allow renegotiation on the server side, as we never request renegotiation. On the client side the situation is different though. There are backends which explicitly request renegotiation, and disabled renegotiation introduces interoperability problems. This change allows renegotiation on the client side, and fixes interoperability problems as observed with such backends (ticket #872). Additionally, with TLSv1.3 the SSL_CB_HANDSHAKE_START flag is currently set by OpenSSL when receiving a NewSessionTicket message, and was detected by nginx as a renegotiation attempt. This looks like a bug in OpenSSL, though this change also allows better interoperability till the problem is fixed.
* SSL: added support for TLSv1.3 in ssl_protocols directive.Sergey Kandaurov2017-04-18
| | | | Support for the TLSv1.3 protocol will be introduced in OpenSSL 1.1.1.
* Set UDP datagram source address (ticket #1239).Roman Arutyunyan2017-04-11
| | | | | | | | | | | | Previously, the source IP address of a response UDP datagram could differ from the original datagram destination address. This could happen if the server UDP socket is bound to a wildcard address and the network interface chosen to output the response packet has a different default address than the destination address of the original packet. For example, if two addresses from the same network are configured on an interface. Now source address is set explicitly if a response is sent for a server UDP socket bound to a wildcard address.
* Core: removed extra ngx_alloc() and ngx_calloc() prototypes.Sergey Kandaurov2017-04-18
|
* Enabled IPV6_RECVPKTINFO / IPV6_PKTINFO on macOS.Sergey Kandaurov2017-04-17
| | | | | This change allows setting the destination IPv6 address of a UDP datagram received on a wildcard socket.
* Added support for the "308 Permanent Redirect" (ticket #877).Simon Leblanc2017-04-11
|
* Mail: configurable socket buffer sizes.Vladimir Homutov2017-04-03
| | | | | The "rcvbuf" and "sndbuf" parameters are now supported by the "listen" directive.
* Stream: configurable socket buffer sizes.Vladimir Homutov2017-04-03
| | | | | The "rcvbuf" and "sndbuf" parameters are now supported by the "listen" directive.
* Core: improved JSON escaping.Valentin Bartenev2017-04-12
| | | | Two-character representations are now used for \b, \f, \n, \r, and \t.
* Use ngx_calloc_buf() where appropriate.Ruslan Ermilov2017-04-12
|
* Version bump.Ruslan Ermilov2017-04-12
|
* Upstream: allow recovery from "429 Too Many Requests" response.Piotr Sikora2017-03-24
| | | | | | | | This change adds "http_429" parameter to "proxy_next_upstream" for retrying rate-limited requests, and to "proxy_cache_use_stale" for serving stale cached responses after being rate-limited. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Added support for "429 Too Many Requests" response (RFC6585).Piotr Sikora2017-03-24
| | | | | | | | This change adds reason phrase in status line and pretty response body when "429" status code is used in "return", "limit_conn_status" and/or "limit_req_status" directives. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Fixed type.hucongcong2017-04-03
|
* Slice filter: prevented slice redirection (ticket #1219).Roman Arutyunyan2017-03-31
| | | | | | | When a slice subrequest was redirected to a new location, its context was lost. After its completion, a new slice subrequest for the same slice was created. This could lead to infinite loop. Now the slice module makes sure each slice subrequest starts output with the slice context available.
* Slice filter: allowed at most one subrequest at a time.Roman Arutyunyan2017-03-28
| | | | | Previously, if slice main request write handler was called while a slice subrequest was running, a new subrequest for the same slice was started.
* Moved handling of wev->delayed to the connection event handler.Maxim Dounin2017-04-02
| | | | | | | | | | | With post_action or subrequests, it is possible that the timer set for wev->delayed will expire while the active subrequest write event handler is not ready to handle this. This results in request hangs as observed with limit_rate / sendfile_max_chunk and post_action (ticket #776) or subrequests (ticket #1228). Moving the handling to the connection event handler fixes the hangs observed, and also slightly simplifies the code.
* Perl: fixed delaying subrequests.Maxim Dounin2017-04-02
| | | | | Much like in limit_req, use the wev->delayed flag to ensure proper handling and interoperability with limit_rate.
* Limit req: fixed delaying subrequests.Maxim Dounin2017-04-02
| | | | | | | | | | | | | | Since limit_req uses connection's write event to delay request processing, it can conflict with timers in other subrequests. In particular, even if applied to an active subrequest, it can break things if wev->delayed is already set (due to limit_rate or sendfile_max_chunk), since after limit_req finishes the wev->delayed flag will be set and no timer will be active. Fix is to use the wev->delayed flag in limit_req as well. This ensures that wev->delayed won't be set after limit_req finishes, and also ensures that limit_req's timers will be properly handled by other subrequests if the one delayed by limit_req is not active.
* HTTP/2: style and typos.Piotr Sikora2017-03-26
| | | | Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* HTTP/2: fixed connection finalization.Valentin Bartenev2017-03-29
| | | | | | | | | | | | | | | | | | | | | | All streams in connection must be finalized before the connection itself can be finalized and all related memory is freed. That's not always possible on the current event loop iteration. Thus when the last stream is finalized, it sets the special read event handler ngx_http_v2_handle_connection_handler() and posts the event. Previously, this handler didn't check the connection state and could call the regular event handler on a connection that was already in finalization stage. In the worst case that could lead to a segmentation fault, since some data structures aren't supposed to be used during connection finalization. Particularly, the waiting queue can contain already freed streams, so the WINDOW_UPDATE frame received by that moment could trigger accessing to these freed streams. Now, the connection error flag is explicitly checked in ngx_http_v2_handle_connection_handler().
* HTTP/2: fixed stream finalization.Valentin Bartenev2017-03-29
| | | | | | | | | | In order to finalize stream the error flag is set on fake connection and either "write" or "read" event handler is called. The read events of fake connections are always ready, but it's not the case with the write events. When the ready flag isn't set, the error flag can be not checked in some cases and as a result stream isn't finalized. Now the ready flag is explicilty set on write events for proper finalization in all cases.
* HTTP/2: emit PROTOCOL_ERROR on padding errors.Piotr Sikora2017-03-26
| | | | Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* HTTP/2: fix flow control with padded DATA frames.Piotr Sikora2017-03-26
| | | | | | | | | Previously, flow control didn't account for padding in DATA frames, which meant that its view of the world could drift from peer's view by up to 256 bytes per received padded DATA frame, which could lead to a deadlock. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* HTTP/2: fix $body_bytes_sent variable.Piotr Sikora2017-03-26
| | | | | | | Previously, its value included payloads and frame headers of HEADERS and CONTINUATION frames. Signed-off-by: Piotr Sikora <piotrsikora@google.com>