summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-06-04Core: added ngx_slab_calloc() and ngx_slab_calloc_locked().Ruslan Ermilov3-16/+37
These functions return zeroed memory, analogous to ngx_pcalloc().
2014-06-18Version bump.Ruslan Ermilov1-2/+2
2014-06-12Upstream: simplified some code that accesses peers.Ruslan Ermilov1-54/+62
No functional changes.
2014-06-03Access log: fix default value, broken by cb308813b453.Piotr Sikora1-5/+2
log->filter ("if" parameter) was uninitialized when the default value was being used, which would lead to a crash (SIGSEGV) when access_log directive wasn't specified in the configuration. Zero-fill the whole structure instead of zeroing fields one-by-one in order to prevent similar issues in the future. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-06-03Core: slab allocator free pages defragmentation.Maxim Dounin2-1/+60
Large allocations from a slab pool result in free page blocks being fragmented, eventually leading to a situation when no further allocation larger than a page size are possible from the pool. While this isn't a problem for nginx itself, it is known to be bad for various 3rd party modules. Fix is to merge adjacent blocks of free pages in the ngx_slab_free_pages() function. Prodded by Wandenberg Peixoto and Yichun Zhang.
2014-06-02Upstream: generic hash module.Roman Arutyunyan5-0/+636
2014-05-29SPDY: fixed operator precedence in uint16/uint32 write macros.Valentin Bartenev1-5/+8
Since the type cast has precedence higher than the bit shift operator, all values were truncated to 8 bits. These macros are used to construct header block for SYN_REPLY frame on platforms with strict alignment requirements. As a result, any response that contains a header with name or value longer than 255 bytes was corrupted on such platforms.
2014-05-28Fixed config parsing of the last try_files parameter.Sergey Kandaurov1-1/+2
Do not taste the last parameter against directory, as otherwise it would result in the trailing slash being cut from the parameter value. Notably, this prevents an internal redirect to an empty URI if the parameter is set to the literal slash: location / { try_files $uri /; }
2014-05-28Configure: added -Wno-deprecated-declarations on OS X.Maxim Dounin1-3/+0
Previous workaround to avoid warnings on OS X due to deprecated system OpenSSL library (introduced in a3870ea96ccd) no longer works, as the MAC_OS_X_VERSION_MIN_REQUIRED macro is ignored on OS X 10.9 if a compiler used supports __attribute__(availability).
2014-05-28Version bump.Maxim Dounin1-2/+2
2014-05-27Sub filter: fixed subrequests handling.Maxim Dounin1-2/+6
In particular, properly output partial match at the end of a subrequest response (much like we do at the end of a response), and reset/set the last_in_chain flag as appropriate. Reported by KAWAHARA Masashi.
2014-05-27Syslog: fixed message sending on win32.Vladimir Homutov1-0/+4
2014-05-26Syslog: fixed possible resource leak and more verbose logging.Vladimir Homutov1-12/+22
Found by Coverity (CID 1215646).
2014-05-23Events: use eventfd() instead of syscall(SYS_eventfd) if possible.Ruslan Ermilov2-4/+7
This fixes --with-file-aio support on systems that lack eventfd() syscall, notably aarch64 Linux. The syscall(SYS_eventfd) may still be necessary on systems that have eventfd() syscall in the kernel but lack it in glibc, e.g. as seen in the current CentOS 5 release.
2014-05-23Upstream: fix tries check in ip_hash.Roman Arutyunyan1-1/+1
Make two checks for maximum number of tries consistent. The other one checks '>' condition.
2014-05-22Mail: output client port number on client connects (ticket #531).Ruslan Ermilov1-2/+6
2014-05-22Core: output client port number when logging accept event.Ruslan Ermilov1-3/+11
2014-05-21Mail: added a check for the number of arguments in MAIL/RCPT.Maxim Dounin1-0/+10
Missed during introduction of the SMTP pipelining support (04e43d03e153, 1.5.6). Previously, the check wasn't needed as s->buffer was used directly and the number of arguments didn't matter. Reported by Svyatoslav Nikolsky.
2014-05-12Added syslog support for error_log and access_log directives.Vladimir Homutov10-21/+540
2014-05-20Configure: the --build= option.Ruslan Ermilov4-3/+9
If set, its value is output in "nginx -v" and in the error log.
2014-05-20SSL: $ssl_client_fingerprint variable.Sergey Budnevitch3-0/+39
2014-05-19Setting $args now invalidates unparsed uri.Maxim Dounin1-1/+19
Prodded by Yichun Zhang.
2014-05-19Charset filter: fixed charset setting on encoded replies.Maxim Dounin3-18/+19
If response is gzipped we can't recode response, but in case it's not needed we still can add charset to Content-Type. The r->ignore_content_encoding is dropped accordingly, charset with gzip_static now properly works without any special flags.
2014-05-16Fixed alias in regex locations with limit_except/if.Maxim Dounin1-18/+10
The ngx_http_map_uri_to_path() function used clcf->regex to detect if it's working within a location given by a regular expression and have to replace full URI with alias (instead of a part matching the location prefix). This is incorrect due to clcf->regex being false in implicit locations created by if and limit_except. Fix is to preserve relevant information in clcf->alias instead, by setting it to NGX_MAX_SIZE_T_VALUE if an alias was specified in a regex location.
2014-04-30SPDY: added protection from overrun of the receive buffer.Valentin Bartenev1-0/+8
2014-04-30SPDY: added a debug point to the state buffer overflow protection.Valentin Bartenev1-0/+1
2014-04-30SPDY: refactored ngx_http_spdy_state_headers().Valentin Bartenev1-9/+4
This change is similar to d2ac5cf4056d. Special flag of completeness looks surplus when there is also a counter of frame bytes left.
2014-04-30SPDY: improved logging.Valentin Bartenev2-62/+151
2014-05-15SPDY: set log action for PROXY protocol only while parsing it.Valentin Bartenev1-8/+9
Handling of PROXY protocol for SPDY connection is currently implemented as a SPDY state. And while nginx waiting for PROXY protocol data it continues to process SPDY connection: initializes zlib context, sends control frames.
2014-04-30SPDY: ngx_http_spdy_state_headers() error handling cleanup.Valentin Bartenev1-39/+61
- Specification-friendly handling of invalid header block or special headers. Such errors are not fatal for session and shouldn't lead to connection close; - Avoid mix of NGX_HTTP_PARSE_INVALID_REQUEST/NGX_HTTP_PARSE_INVALID_HEADER.
2014-04-30SPDY: improved error handling of header block decompression.Valentin Bartenev1-17/+43
Now cases when decompression failed due to internal error and when a client sent corrupted data are distinguished.
2014-04-30SPDY: removed ngx_http_spdy_state_headers_error().Valentin Bartenev1-20/+6
The function just calls ngx_http_spdy_state_headers_skip() most of the time. There was also an attempt of optimization to stop parsing if the client already closed connection, but it looks strange and unfinished anyway.
2014-05-15SPDY: prevented creation of RST_STREAM in protocol error state.Valentin Bartenev1-0/+1
Previously, the frame wasn't sent anyway (and had a wrong status code).
2014-04-30SPDY: improved ngx_http_spdy_state_protocol_error().Valentin Bartenev1-9/+15
Now ngx_http_spdy_state_protocol_error() is able to close stream, so there is no need in a separate call for this. Also fixed zero status code in logs for some cases.
2014-04-30SPDY: fixed one case of improper memory allocation error handling.Valentin Bartenev1-1/+2
Now ngx_http_spdy_construct_request_line() doesn't try to finalize request in case of failed memory allocation.
2014-05-14Style: use %N instead of '\n' where appropriate.Ruslan Ermilov2-2/+2
2014-05-14Core: use '\r' for CR and '\n' for LF definitions.Ruslan Ermilov1-3/+3
2014-04-29OCSP stapling: missing OCSP request free call.Filipe da Silva1-0/+2
2014-04-30Upstream: restored workaround for "if".Maxim Dounin1-3/+4
The 7022564a9e0e changeset made ineffective workaround from 2464ccebdb52 to avoid NULL pointer dereference with "if". It is now restored by moving the u->ssl_name initialization after the check. Found by Coverity (CID 1210408).
2014-04-30Core: improved ngx_conf_parse() error handling.Maxim Dounin1-1/+1
Previous code failed to properly restore cf->conf_file in case of ngx_close_file() errors, potentially resulting in double free of cf->conf_file->buffer->start. Found by Coverity (CID 1087507).
2014-04-30Core: fixed error handling in ngx_reopen_files().Maxim Dounin1-0/+6
Found by Coverity (CID 1087509).
2014-04-30Cache: added ngx_quit check to ngx_http_file_cache_expire().Maxim Dounin1-0/+5
While managing big caches it is possible that expiring old cache items in ngx_http_file_cache_expire() will take a while. Added a check for ngx_quit / ngx_terminate to make sure cache manager can be terminated while in ngx_http_file_cache_expire().
2014-04-29Upstream: added the "$upstream_cookie_<name>" variables.Vladimir Homutov5-3/+130
2013-11-18Proxy: fixed possible uninitialized memory access.Valentin Bartenev1-3/+3
The ngx_http_proxy_rewrite_cookie() function expects the value of the "Set-Cookie" header to be null-terminated, and for headers obtained from proxied server it is usually true. Now the ngx_http_proxy_rewrite() function preserves the null character while rewriting headers. This fixes accessing memory outside of rewritten value if both the "proxy_cookie_path" and "proxy_cookie_domain" directives are used in the same location.
2014-04-24Version bump.Valentin Bartenev1-2/+2
2014-04-23SSL: explicit handling of empty names.Maxim Dounin1-0/+4
X509_check_host() can't handle non null-terminated names with zero length, so make sure to fail before calling it.
2014-04-22Upstream: for ssl name, non-aligned memory allocation is enough.Ruslan Ermilov1-1/+1
2014-04-22SSL: added explicit check for ngx_strlchr() result.Maxim Dounin1-0/+5
2014-04-21SPDY: avoid sending RST_STREAM on WINDOW_UPDATE with unknown SID.Valentin Bartenev1-10/+2
There's a race condition between closing a stream by one endpoint and sending a WINDOW_UPDATE frame by another. So it would be better to just skip such frames for unknown streams, like is already done for the DATA frames.
2014-04-21SPDY: Stream-ID restrictions according to specification.Valentin Bartenev1-2/+21