summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-09-20Perl: pass additional linker options to perl module.Konstantin Pavlov1-0/+2
Previously flags passed by --with-ld-opt were not used when building perl module, which meant hardening flags provided by package build systems were not applied.
2016-09-20Fixed log levels of configuration parsing errors.Valentin Bartenev5-10/+10
All the errors that prevent loading configuration must be printed on the "emerg" log level. Previously, nginx might silently fail to load configuration in some cases as the default log level is "error".
2016-09-20Removed influence of some options on structures.Ruslan Ermilov3-8/+1
2016-09-16Upstream hash: fixed missing upstream name initialization.Vladimir Homutov2-0/+2
2016-09-15Stream ssl_preread: removed internal macro.Vladimir Homutov1-6/+6
The ngx_log_debug() macro is internal and should not be used.
2016-09-15Stream: ssl_preread module.Vladimir Homutov1-0/+448
The ssl_preread module extracts information from the SSL Client Hello message without terminating SSL. Currently, only $ssl_preread_server_name variable is supported, which contains server name from the SNI extension.
2016-09-15Stream: preread phase.Vladimir Homutov3-1/+145
In this phase, head of a stream is read and analysed before proceeding to the content phase. Amount of data read is controlled by the module implementing the phase, but not more than defined by the "preread_buffer_size" directive. The time spent on processing preread is controlled by the "preread_timeout" directive. The typical preread phase module will parse the beginning of a stream and set variable that may be used by the content phase, for example to make routing decision.
2016-09-15Stream: phases.Roman Arutyunyan9-183/+425
2016-09-15Stream: filters.Roman Arutyunyan20-100/+733
2016-09-15Version bump.Vladimir Homutov1-2/+2
2016-09-12OCSP stapling: fixed using wrong responder with multiple certs.Maxim Dounin1-0/+3
2016-09-12SSL: improved session ticket callback error handling.Sergey Kandaurov1-3/+32
Prodded by Guido Vranken.
2016-09-12SSL: factored out digest and cipher in session ticket callback.Sergey Kandaurov1-14/+14
No functional changes.
2016-09-08Stream: increase default value for proxy_protocol_timeout to 30s.Dmitry Volyntsev1-1/+1
2016-09-01Stream: realip module.Dmitry Volyntsev3-0/+352
2016-09-07Core: introduced ngx_cidr_match() function.Dmitry Volyntsev3-98/+112
2016-09-06Stream: allow using the session context inside handlers.Dmitry Volyntsev1-21/+16
Previously, it was not possible to use the stream context inside ngx_stream_init_connection() handlers. Now, limit_conn, access handlers, as well as those added later, can create their own contexts.
2016-09-06Stream: $proxy_protocol_addr and $proxy_protocol_port.Dmitry Volyntsev1-0/+50
2016-09-06Stream: the "proxy_protocol" parameter of the "listen" directive.Dmitry Volyntsev4-1/+122
2016-09-06Stream: postpone session initialization under accept mutex.Dmitry Volyntsev2-3/+42
Previously, it was possible that some system calls could be invoked while holding the accept mutex. This is clearly wrong as it prevents incoming connections from being accepted as quickly as possible.
2016-09-05Stream: log module.Vladimir Homutov5-0/+1554
2016-09-02Stream: upstream response time variables.Vladimir Homutov3-0/+103
The $upstream_connect_time, $upstream_first_byte_time and $upstream_session_time variables keep corresponding times.
2016-09-02Stream: $upstream_bytes_sent and $upstream_bytes_received.Vladimir Homutov3-2/+78
2016-09-02Stream: the $upstream_addr variable.Vladimir Homutov4-2/+116
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".
2016-08-11Stream: the $status variable.Roman Arutyunyan5-57/+112
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
2016-09-01Event pipe: do not set file's thread_handler if not needed.Maxim Dounin1-4/+6
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.
2016-09-01Event pipe: process data after recv_chain() errors.Maxim Dounin1-1/+1
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).
2016-09-01Realip: fixed uninitialized memory access.Roman Arutyunyan1-1/+1
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.
2016-08-26Stream: the $protocol variable.Vladimir Homutov1-0/+19
The variable keeps protocol used by the client, "TCP" or "UDP".
2016-08-26Stream: the $session_time variable.Vladimir Homutov3-0/+41
The variable keeps time spent on processing the stream session.
2016-08-26Stream: the $bytes_received variable.Vladimir Homutov1-4/+13
The variable keeps the number of bytes received from the client.
2016-08-15Thread pools: create threads in detached state.Piotr Sikora1-0/+7
This prevents theoretical resource leak, since those threads are never joined. Found with ThreadSanitizer. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-08-25Geo: fixed indentation.Sergey Kandaurov1-5/+5
2016-08-23Geo: fixed warnings when removing nonexistent ranges.Ruslan Ermilov2-14/+6
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 }
2016-08-23Geo: fixed insertion of ranges specified in descending order.Ruslan Ermilov2-6/+16
2016-08-23Geo: fixed removing a range in certain cases.Ruslan Ermilov2-2/+2
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).
2016-08-23Geo: fixed overflow when iterating over ranges.Ruslan Ermilov2-4/+20
2016-08-22SSL: adopted session ticket handling for OpenSSL 1.1.0.Sergey Kandaurov1-1/+1
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.
2016-08-18SSL: remove no longer needed workaround for BoringSSL.Piotr Sikora1-2/+0
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>
2016-08-22Events: fixed setting of IP_BIND_ADDRESS_NO_PORT/SO_REUSEADDR.Ruslan Ermilov1-1/+1
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.
2016-08-17Ensure "listen" exists in a mail or stream server (ticket #1049).Roman Arutyunyan4-0/+24
2016-08-18Fixed wrong type of the "line" field.Roman Arutyunyan2-2/+2
The new type ngx_uint_t was supposed when formatting the line number.
2016-08-18Geo: fixed access to already freed memory.Valentin Bartenev2-2/+12
Previously, in "ranges" mode when all added ranges were deleted, the ctx.high.low[i] was left pointing to a temporary array.
2016-08-10Upstream: the $upstream_bytes_received variable.Vladimir Homutov2-1/+22
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.
2016-08-08Simplified extraction of current time.Ruslan Ermilov2-16/+8
2016-08-08SSL: guarded SSL_R_NO_CIPHERS_PASSED not present in OpenSSL 1.1.0.Sergey Kandaurov1-0/+2
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.
2016-08-04Always seed PRNG with PID, seconds, and milliseconds.Ruslan Ermilov4-11/+19
2016-08-04Fixed undefined behavior when left shifting signed integer.Ruslan Ermilov1-1/+1
2016-08-04Win32: added per-thread random seeding.Ruslan Ermilov1-0/+2
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.
2016-07-26Stream: fixed build without stream_ssl_module (ticket #1032).Vladimir Homutov1-2/+2