]> git.kaiwu.me - nginx.git/log
nginx.git
11 years agoAvoided to add duplicate hash key in ngx_http_types_slot().
Gu Feng [Wed, 17 Sep 2014 14:52:02 +0000 (22:52 +0800)]
Avoided to add duplicate hash key in ngx_http_types_slot().

11 years agoRemoved duplicate initialization of the "rev" variable.
Valentin Bartenev [Mon, 22 Sep 2014 15:48:23 +0000 (19:48 +0400)]
Removed duplicate initialization of the "rev" variable.

11 years agoGeneralized definitions of the number of preallocated iovec's.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Generalized definitions of the number of preallocated iovec's.

No functional changes.

11 years agoReduced difference between the send chain functions.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Reduced difference between the send chain functions.

No functional changes.  This follows the change from ad137a80919f.

11 years agoMerged implementations of ngx_readv_chain().
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Merged implementations of ngx_readv_chain().

There's no real need in two separate implementations,
with and without kqueue support.

11 years agoRemoved the "complete" variable from various send chain functions.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Removed the "complete" variable from various send chain functions.

It was made redundant by the previous change, since the "sent" variable
is no longer modified.

11 years agoMoved the code for adjusting sent buffers in a separate function.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Moved the code for adjusting sent buffers in a separate function.

11 years agoFixed writev() debug log message in ngx_darwin_sendfile_chain().
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Fixed writev() debug log message in ngx_darwin_sendfile_chain().

11 years agoUpstream: fixed file buffers reinit in ngx_http_upstream_reinit().
Roman Arutyunyan [Thu, 18 Sep 2014 12:37:16 +0000 (16:37 +0400)]
Upstream: fixed file buffers reinit in ngx_http_upstream_reinit().

Previously, a file buffer start position was reset to the file start.
Now it's reset to the previous file buffer end.  This fixes
reinitialization of requests having multiple successive parts of a
single file.  Such requests are generated by fastcgi module.

11 years agoFastCGI: fixed start pointers in request buffers.
Roman Arutyunyan [Thu, 18 Sep 2014 12:37:14 +0000 (16:37 +0400)]
FastCGI: fixed start pointers in request buffers.

The start pointers are used in ngx_http_upstream_reinit() to
reinit FastCGI requests.

11 years agoLimit req: don't truncate key value to 255 bytes.
Valentin Bartenev [Tue, 16 Sep 2014 17:12:51 +0000 (21:12 +0400)]
Limit req: don't truncate key value to 255 bytes.

While the module allows to use values up to 65535 bytes as a key,
that actually never worked properly.

11 years agoVersion bump.
Valentin Bartenev [Wed, 17 Sep 2014 08:04:47 +0000 (12:04 +0400)]
Version bump.

11 years agorelease-1.7.5 tag
Maxim Dounin [Tue, 16 Sep 2014 12:19:03 +0000 (16:19 +0400)]
release-1.7.5 tag

11 years agonginx-1.7.5-RELEASE release-1.7.5
Maxim Dounin [Tue, 16 Sep 2014 12:19:03 +0000 (16:19 +0400)]
nginx-1.7.5-RELEASE

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Mon, 15 Sep 2014 14:03:49 +0000 (18:03 +0400)]
Updated OpenSSL used for win32 builds.

11 years agoSSL: session id context now includes certificate hash.
Maxim Dounin [Mon, 15 Sep 2014 13:59:47 +0000 (17:59 +0400)]
SSL: session id context now includes certificate hash.

This prevents inappropriate session reuse in unrelated server{}
blocks, while preserving ability to restore sessions on other servers
when using TLS Session Tickets.

Additionally, session context is now set even if there is no session cache
configured.  This is needed as it's also used for TLS Session Tickets.

Thanks to Antoine Delignat-Lavaud and Piotr Sikora.

11 years agoAccess log: fixed the "if=" parameter with buffering (ticket #625).
Valentin Bartenev [Sat, 13 Sep 2014 17:47:13 +0000 (21:47 +0400)]
Access log: fixed the "if=" parameter with buffering (ticket #625).

It might not work if there were more than one "access_log" directives
pointed to the same file and duplicate buffer parameters.

11 years agoUpstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan [Fri, 12 Sep 2014 14:50:47 +0000 (18:50 +0400)]
Upstream: limited next_upstream time and tries (ticket #544).

The new directives {proxy,fastcgi,scgi,uwsgi,memcached}_next_upstream_tries
and {proxy,fastcgi,scgi,uwsgi,memcached}_next_upstream_timeout limit
the number of upstreams tried and the maximum time spent for these tries
when searching for a valid upstream.

11 years agoUpstream: included backup peers into peer.tries.
Roman Arutyunyan [Fri, 12 Sep 2014 14:50:46 +0000 (18:50 +0400)]
Upstream: included backup peers into peer.tries.

Since peer.tries is never reset it can now be limited if required.

11 years agoUpstream keepalive: removed "single" parameter remnants.
Maxim Dounin [Thu, 11 Sep 2014 16:09:04 +0000 (20:09 +0400)]
Upstream keepalive: removed "single" parameter remnants.

The "single" parameter is deprecated and ignored since 5b5c07dee156 (1.3.2).

11 years agoAdded warning about unset cache keys.
Maxim Dounin [Thu, 11 Sep 2014 16:08:52 +0000 (20:08 +0400)]
Added warning about unset cache keys.

In fastcgi, scgi and uwsgi modules there are no default cache keys, and
using a cache without a cache key set is likely meaningless.

11 years agoStyle.
Maxim Dounin [Thu, 11 Sep 2014 16:08:45 +0000 (20:08 +0400)]
Style.

11 years agoUpstream: avoided directly terminating the connection.
FengGu [Wed, 13 Aug 2014 06:53:55 +0000 (14:53 +0800)]
Upstream: avoided directly terminating the connection.

When memory allocation failed in ngx_http_upstream_cache(), the connection
would be terminated directly in ngx_http_upstream_init_request().
Return a INTERNAL_SERVER_ERROR response instead.

11 years agoAdded ngx_init_setproctitle() return code check.
Maxim Dounin [Mon, 8 Sep 2014 17:36:09 +0000 (21:36 +0400)]
Added ngx_init_setproctitle() return code check.

The ngx_init_setproctitle() function, as used on systems without
setproctitle(3), may fail due to memory allocation errors, and
therefore its return code needs to be checked.

Reported by Markus Linnala.

11 years agoFixed ETag memory allocation error handling.
Maxim Dounin [Mon, 8 Sep 2014 17:36:03 +0000 (21:36 +0400)]
Fixed ETag memory allocation error handling.

The etag->hash must be set to 0 to avoid an empty ETag header being
returned with the 500 Internal Server Error page after the memory
allocation failure.

Reported by Markus Linnala.

11 years agoCore: ngx_regex_compile() error handling fixes.
Maxim Dounin [Mon, 8 Sep 2014 17:35:53 +0000 (21:35 +0400)]
Core: ngx_regex_compile() error handling fixes.

Now we actually return NGX_ERROR on errors, and provide an error
string for memory allocation errors.

Reported by Markus Linnala.

11 years agoSSL: guard use of all SSL options for bug workarounds.
Piotr Sikora [Wed, 3 Sep 2014 21:49:55 +0000 (14:49 -0700)]
SSL: guard use of all SSL options for bug workarounds.

Some of the OpenSSL forks (read: BoringSSL) started removing unused,
no longer necessary and/or not really working bug workarounds along
with the SSL options and defines for them.

Instead of fixing nginx build after each removal, be proactive
and guard use of all SSL options for bug workarounds.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoUpstream: suppressed the file cache slab allocator error messages.
Roman Arutyunyan [Fri, 5 Sep 2014 14:14:59 +0000 (18:14 +0400)]
Upstream: suppressed the file cache slab allocator error messages.

The messages "ngx_slab_alloc() failed: no memory in cache keys zone"
from the file cache slab allocator are suppressed since the allocation
is likely to succeed after the forced expiration of cache nodes.
The second allocation failure is reported.

11 years agoEvents: processing of posted events changed from LIFO to FIFO.
Valentin Bartenev [Mon, 1 Sep 2014 14:20:18 +0000 (18:20 +0400)]
Events: processing of posted events changed from LIFO to FIFO.

In theory, this can provide a bit better distribution of latencies.

Also it simplifies the code, since ngx_queue_t is now used instead
of custom implementation.

11 years agoEvents: removed broken thread support from posted events.
Valentin Bartenev [Mon, 1 Sep 2014 14:20:03 +0000 (18:20 +0400)]
Events: removed broken thread support from posted events.

It's mostly dead code.  And the idea of thread support for this task has
been deprecated.

11 years agoMail: initialize the "signature" field of ngx_mail_session_t.
Valentin Bartenev [Mon, 1 Sep 2014 13:50:59 +0000 (17:50 +0400)]
Mail: initialize the "signature" field of ngx_mail_session_t.

Currently it isn't used, but it can be suitable to distinguish
objects stored in c->data.

11 years agoUpstream: improved configuration parser diagnostics.
Ruslan Ermilov [Mon, 1 Sep 2014 08:27:38 +0000 (12:27 +0400)]
Upstream: improved configuration parser diagnostics.

Made it clear when the selected balancing method does not
support certain parameters of the "server" directive.

11 years agoHeaders filter: "add_header" with "always" parameter (ticket #98).
Sergey Kandaurov [Fri, 29 Aug 2014 14:00:10 +0000 (18:00 +0400)]
Headers filter: "add_header" with "always" parameter (ticket #98).

If specified, the header field is set regardless of the status code.

11 years agoVariables: updated list of prefixes in ngx_http_rewrite_set().
Maxim Dounin [Wed, 27 Aug 2014 17:38:08 +0000 (21:38 +0400)]
Variables: updated list of prefixes in ngx_http_rewrite_set().

11 years agoVariables: fixed non-indexed access of prefix vars (ticket #600).
Maxim Dounin [Wed, 27 Aug 2014 17:38:04 +0000 (21:38 +0400)]
Variables: fixed non-indexed access of prefix vars (ticket #600).

Previously, a configuration like

    location / {
        ssi on;
        ssi_types *;
        set $http_foo "bar";
        return 200 '<!--#echo var="http_foo" -->\n';
    }

resulted in NULL pointer dereference in ngx_http_get_variable() as
the variable was explicitly added to the variables hash, but its
get_handler wasn't properly set in the hash.  Fix is to make sure
that get_handler is properly set by ngx_http_variables_init_vars().

11 years agoSPDY: added a comment about handling stream with the timer set.
Valentin Bartenev [Mon, 18 Aug 2014 09:23:45 +0000 (13:23 +0400)]
SPDY: added a comment about handling stream with the timer set.

11 years agoSPDY: avoid setting timeout on stream events in ngx_http_writer().
Valentin Bartenev [Wed, 27 Aug 2014 16:44:11 +0000 (20:44 +0400)]
SPDY: avoid setting timeout on stream events in ngx_http_writer().

The SPDY module doesn't expect timers can be set on stream events for reasons
other than delaying output.  But ngx_http_writer() could add timer on write
event if the delayed flag wasn't set and nginx is waiting for AIO completion.
That could cause delays in sending response over SPDY when file AIO was used.

11 years agoResolver: notify all waiting requests on timeout.
Ruslan Ermilov [Tue, 19 Aug 2014 11:43:26 +0000 (15:43 +0400)]
Resolver: notify all waiting requests on timeout.

If a "resolver_timeout" occurs, only the first waiting request
was notified.  Other requests may hang forever.

11 years agoStub status: corrected the "stub_status" directive.
Ruslan Ermilov [Tue, 26 Aug 2014 13:35:23 +0000 (17:35 +0400)]
Stub status: corrected the "stub_status" directive.

The "stub_status" directive does not require an argument.

11 years agoSub filter: fixed matching for a single character.
Valentin Bartenev [Mon, 25 Aug 2014 12:08:55 +0000 (16:08 +0400)]
Sub filter: fixed matching for a single character.

11 years agoMail: fixed number of arguments allowed in the listen directive.
Valentin Bartenev [Wed, 20 Aug 2014 09:13:27 +0000 (13:13 +0400)]
Mail: fixed number of arguments allowed in the listen directive.

11 years agoMail: fixed a comment.
Valentin Bartenev [Wed, 20 Aug 2014 09:13:27 +0000 (13:13 +0400)]
Mail: fixed a comment.

There's no loc_conf in the mail module.

11 years agoMp4: use trak->smhd_size in ngx_http_mp4_read_smhd_atom().
Roman Arutyunyan [Tue, 19 Aug 2014 10:13:39 +0000 (14:13 +0400)]
Mp4: use trak->smhd_size in ngx_http_mp4_read_smhd_atom().

Reported by Gang Li.

11 years agoImage filter: downgrade strong etags to weak ones as needed.
Sergey Kandaurov [Mon, 18 Aug 2014 08:03:41 +0000 (12:03 +0400)]
Image filter: downgrade strong etags to weak ones as needed.

11 years agoFixed typo.
Sergey Kandaurov [Fri, 15 Aug 2014 10:09:29 +0000 (14:09 +0400)]
Fixed typo.

11 years agoEvents: removed unused variable in ngx_poll_process_events().
Maxim Dounin [Sun, 10 Aug 2014 13:44:46 +0000 (17:44 +0400)]
Events: removed unused variable in ngx_poll_process_events().

11 years agoEvents: format specifier fixes.
Yves Crespin [Thu, 7 Aug 2014 13:04:43 +0000 (15:04 +0200)]
Events: format specifier fixes.

11 years agoEvents: changed nevents type to unsigned in poll module.
Yves Crespin [Thu, 7 Aug 2014 12:56:57 +0000 (14:56 +0200)]
Events: changed nevents type to unsigned in poll module.

11 years agoStyle: use specified macro instead of magic-number.
Tatsuhiko Kubo [Wed, 6 Aug 2014 14:58:44 +0000 (23:58 +0900)]
Style: use specified macro instead of magic-number.

11 years agoPerl: NULL-terminate argument list.
Piotr Sikora [Thu, 19 Jun 2014 11:16:36 +0000 (04:16 -0700)]
Perl: NULL-terminate argument list.

perl_parse() function expects argv/argc-style argument list,
which according to the C standard must be NULL-terminated,
that is: argv[argc] == NULL.

This change fixes a crash (SIGSEGV) that could happen because
of the buffer overrun during perl module initialization.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoAccess log: allowed logs to syslog with "if=" (ticket #596).
Maxim Dounin [Tue, 5 Aug 2014 20:22:36 +0000 (00:22 +0400)]
Access log: allowed logs to syslog with "if=" (ticket #596).

11 years agoVersion bump.
Maxim Dounin [Tue, 5 Aug 2014 18:50:25 +0000 (22:50 +0400)]
Version bump.

11 years agorelease-1.7.4 tag
Maxim Dounin [Tue, 5 Aug 2014 11:13:05 +0000 (15:13 +0400)]
release-1.7.4 tag

11 years agonginx-1.7.4-RELEASE release-1.7.4
Maxim Dounin [Tue, 5 Aug 2014 11:13:04 +0000 (15:13 +0400)]
nginx-1.7.4-RELEASE

11 years agoMail: discard pipelined commands after SMTP STARTTLS.
Maxim Dounin [Tue, 5 Aug 2014 08:22:07 +0000 (12:22 +0400)]
Mail: discard pipelined commands after SMTP STARTTLS.

The bug had appeared in nginx 1.5.6 (04e43d03e153).

Reported by Chris Boulton.

11 years agoCore: exit on ngx_pnalloc() failure.
Piotr Sikora [Sat, 2 Aug 2014 03:39:22 +0000 (20:39 -0700)]
Core: exit on ngx_pnalloc() failure.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoStyle: use ngx_free() instead of free().
Tatsuhiko Kubo [Sat, 2 Aug 2014 18:27:39 +0000 (03:27 +0900)]
Style: use ngx_free() instead of free().

11 years agoCore: improved ngx_pstrdup() error handling.
Tatsuhiko Kubo [Fri, 1 Aug 2014 11:04:14 +0000 (20:04 +0900)]
Core: improved ngx_pstrdup() error handling.

11 years agoStatus: indentation and style, no functional changes.
Sergey Kandaurov [Fri, 1 Aug 2014 14:36:35 +0000 (18:36 +0400)]
Status: indentation and style, no functional changes.

11 years agoConfigure: remove outdated and unused patch.zlib.h.
Piotr Sikora [Thu, 31 Jul 2014 10:52:28 +0000 (03:52 -0700)]
Configure: remove outdated and unused patch.zlib.h.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoDav: ngx_http_map_uri_to_path() errors were not checked.
FengGu [Wed, 30 Jul 2014 06:45:08 +0000 (14:45 +0800)]
Dav: ngx_http_map_uri_to_path() errors were not checked.

Once error occured, it could lead to use uninitialized variables to log,
even more segmentation fault.

11 years agoTypos fixed.
Sergey Kandaurov [Thu, 31 Jul 2014 09:59:37 +0000 (13:59 +0400)]
Typos fixed.

11 years agoSSL: let it build against LibreSSL.
Piotr Sikora [Wed, 30 Jul 2014 11:32:16 +0000 (04:32 -0700)]
SSL: let it build against LibreSSL.

LibreSSL developers decided that LibreSSL is OpenSSL-2.0.0, so tests
for OpenSSL-1.0.2+ are now passing, even though the library doesn't
provide functions that are expected from that version of OpenSSL.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoSSL: let it build against BoringSSL.
Piotr Sikora [Wed, 30 Jul 2014 11:32:15 +0000 (04:32 -0700)]
SSL: let it build against BoringSSL.

This change adds support for using BoringSSL as a drop-in replacement
for OpenSSL without adding support for any of the BoringSSL-specific
features.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoSSL: fix build with OPENSSL_NO_ENGINE and/or OPENSSL_NO_OCSP.
Piotr Sikora [Mon, 28 Jul 2014 19:27:57 +0000 (12:27 -0700)]
SSL: fix build with OPENSSL_NO_ENGINE and/or OPENSSL_NO_OCSP.

This is really just a prerequisite for building against BoringSSL,
which doesn't provide either of those features.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoBigger iovec buffer in ngx_readv_chain().
Maxim Dounin [Mon, 28 Jul 2014 14:30:19 +0000 (18:30 +0400)]
Bigger iovec buffer in ngx_readv_chain().

This helps to reduce likelyhood of memory allocations in ngx_readv_chain(),
which are known to lead to noticeable effects in some cases, see
http://mailman.nginx.org/pipermail/nginx/2014-July/044512.html.

11 years agoSSL: misplaced space in debug message.
Maxim Dounin [Mon, 28 Jul 2014 14:30:18 +0000 (18:30 +0400)]
SSL: misplaced space in debug message.

11 years agoUpstream: SSL handshake timeouts.
Maxim Dounin [Mon, 28 Jul 2014 14:30:14 +0000 (18:30 +0400)]
Upstream: SSL handshake timeouts.

Timeout may not be set on an upstream connection when we call
ngx_ssl_handshake() in ngx_http_upstream_ssl_init_connection(),
so make sure to arm it if it's not set.

Based on a patch by Yichun Zhang.

11 years agoGeoIP: not all variable fields were initialized.
Yichun Zhang [Fri, 25 Jul 2014 21:43:29 +0000 (14:43 -0700)]
GeoIP: not all variable fields were initialized.

The ngx_http_geoip_city_float_variable and
ngx_http_geoip_city_int_variable functions did not always initialize
all variable fields like "not_found", which could lead to empty values
for those corresponding nginx variables randomly.

11 years agoCore: use uppercase hexadecimal digits for percent-encoding.
Piotr Sikora [Fri, 27 Jun 2014 06:39:23 +0000 (23:39 -0700)]
Core: use uppercase hexadecimal digits for percent-encoding.

RFC3986 says that, for consistency, URI producers and normalizers
should use uppercase hexadecimal digits for all percent-encodings.

This is also what modern web browsers and other tools use.

Using lowercase hexadecimal digits makes it harder to interact with
those tools in case when use of the percent-encoded URI is required,
for example when $request_uri is part of the cache key.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoCore: fixed default log initialization.
Vladimir Homutov [Thu, 24 Jul 2014 12:25:07 +0000 (16:25 +0400)]
Core: fixed default log initialization.

The ngx_log_insert() function may invalidate pointer passed to it,
so make sure to don't use it after the ngx_log_insert() call.

11 years agoUpstream: ngx_http_upstream_store() error handling fixes.
Maxim Dounin [Fri, 18 Jul 2014 16:11:40 +0000 (20:11 +0400)]
Upstream: ngx_http_upstream_store() error handling fixes.

Previously, ngx_http_map_uri_to_path() errors were not checked in
ngx_http_upstream_store().  Moreover, in case of errors temporary
files were not deleted, as u->store was set to 0, preventing cleanup
code in ngx_http_upstream_finalize_request() from removing them.  With
this patch, u->store is set to 0 only if there were no errors.

Reported by Feng Gu.

11 years agoReset of r->uri.len on URI parsing errors.
Maxim Dounin [Fri, 18 Jul 2014 16:02:11 +0000 (20:02 +0400)]
Reset of r->uri.len on URI parsing errors.

This ensures that debug logging and the $uri variable (if used in
400 Bad Request processing) will not try to access uninitialized
memory.

Found by Sergey Bobrov.

11 years agoResolver: fixed resend on malformed responses.
Ruslan Ermilov [Wed, 16 Jul 2014 06:21:28 +0000 (10:21 +0400)]
Resolver: fixed resend on malformed responses.

DNS request resend on malformed responses was broken in 98876ce2a7fd (1.5.8).

Reported by Pramod Korathota.

11 years agoSSL: fix build with recent OpenSSL.
Piotr Sikora [Wed, 9 Jul 2014 19:27:15 +0000 (12:27 -0700)]
SSL: fix build with recent OpenSSL.

X509_check_host() prototype changed recently:
- http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=ced3d91
- http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=297c67f

Bump version requirement, so that OpenSSL-1.0.2-beta1 uses fallback code.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoCore: bugfix for the ngx_slab_max_size case.
Jianjun Zheng [Wed, 18 Jun 2014 08:39:59 +0000 (16:39 +0800)]
Core: bugfix for the ngx_slab_max_size case.

11 years agoStyle: use ngx_str_set().
Tatsuhiko Kubo [Wed, 9 Jul 2014 14:23:59 +0000 (23:23 +0900)]
Style: use ngx_str_set().

11 years agoStyle: use ngx_str_null().
Tatsuhiko Kubo [Wed, 9 Jul 2014 14:22:14 +0000 (23:22 +0900)]
Style: use ngx_str_null().

11 years agoStyle: use ngx_strlen() instead of strlen().
Tatsuhiko Kubo [Wed, 9 Jul 2014 14:20:40 +0000 (23:20 +0900)]
Style: use ngx_strlen() instead of strlen().

11 years agoSPDY: fix support for headers with multiple values.
Piotr Sikora [Tue, 8 Jul 2014 09:17:44 +0000 (02:17 -0700)]
SPDY: fix support for headers with multiple values.

Split SPDY header with multiple, NULL-separated values:

    cookie: foo\0bar

into two separate HTTP headers with the same name:

    cookie: foo
    cookie: bar

Even though the logic for this behavior already existed
in the source code, it doesn't look that it ever worked
and SPDY streams with such headers were simply rejected.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoStyle: fix typo.
Piotr Sikora [Tue, 8 Jul 2014 10:03:14 +0000 (03:03 -0700)]
Style: fix typo.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoStyle: use ngx_memcpy() instead of memcpy().
Piotr Sikora [Tue, 8 Jul 2014 10:03:14 +0000 (03:03 -0700)]
Style: use ngx_memcpy() instead of memcpy().

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoStyle: keep return type and function name on different lines.
Piotr Sikora [Tue, 8 Jul 2014 10:03:14 +0000 (03:03 -0700)]
Style: keep return type and function name on different lines.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoStyle: remove whitespace between function name and parentheses.
Piotr Sikora [Tue, 8 Jul 2014 10:03:14 +0000 (03:03 -0700)]
Style: remove whitespace between function name and parentheses.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoStyle: add whitespace between control statement and parentheses.
Piotr Sikora [Tue, 8 Jul 2014 10:03:13 +0000 (03:03 -0700)]
Style: add whitespace between control statement and parentheses.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoSSL: stop accessing SSL_SESSION's fields directly.
Piotr Sikora [Sun, 6 Jul 2014 23:41:14 +0000 (16:41 -0700)]
SSL: stop accessing SSL_SESSION's fields directly.

SSL_SESSION struct is internal part of the OpenSSL library and it's fields
should be accessed via API (when exposed), not directly.

The unfortunate side-effect of this change is that we're losing reference
count that used to be printed at the debug log level, but this seems to be
an acceptable trade-off.

Almost fixes build with -DOPENSSL_NO_SSL_INTERN.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoSSL: fixed build with OPENSSL_NO_DEPRECATED defined.
Maxim Dounin [Wed, 9 Jul 2014 00:08:13 +0000 (04:08 +0400)]
SSL: fixed build with OPENSSL_NO_DEPRECATED defined.

The RSA_generate_key() is marked as deprecated and causes build to
fail.  On the other hand, replacement function, RSA_generate_key_ex(),
requires much more code.  Since RSA_generate_key() is only needed
for barely usable EXP ciphers, the #ifdef was added instead.

Prodded by Piotr Sikora.

11 years agoSSL: return temporary RSA key only when the key length matches.
Piotr Sikora [Sun, 6 Jul 2014 23:41:13 +0000 (16:41 -0700)]
SSL: return temporary RSA key only when the key length matches.

This change is mostly cosmetic, because in practice this callback
is used only for 512-bit RSA keys.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoSSL: include correct OpenSSL headers.
Piotr Sikora [Sun, 6 Jul 2014 23:41:13 +0000 (16:41 -0700)]
SSL: include correct OpenSSL headers.

Previously, <bn.h>, <dh.h>, <rand.h> and <rsa.h> were pulled in
by <engine.h> using OpenSSL's deprecated interface, which meant
that nginx couldn't have been built with -DOPENSSL_NO_DEPRECATED.

Both <x509.h> and <x509v3.h> are pulled in by <ocsp.h>, but we're
calling X509 functions directly, so let's include those as well.

<crypto.h> is pulled in by virtually everything, but we're calling
CRYPTO_add() directly, so let's include it as well.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoVersion bump.
Maxim Dounin [Tue, 8 Jul 2014 23:15:00 +0000 (03:15 +0400)]
Version bump.

11 years agorelease-1.7.3 tag
Maxim Dounin [Tue, 8 Jul 2014 13:22:38 +0000 (17:22 +0400)]
release-1.7.3 tag

11 years agonginx-1.7.3-RELEASE release-1.7.3
Maxim Dounin [Tue, 8 Jul 2014 13:22:38 +0000 (17:22 +0400)]
nginx-1.7.3-RELEASE

11 years agoWin32: ngx_open_dir() and ngx_close_dir() fixes.
Maxim Dounin [Sat, 5 Jul 2014 19:29:47 +0000 (23:29 +0400)]
Win32: ngx_open_dir() and ngx_close_dir() fixes.

The ngx_open_dir() function changed to restore name passed to it.  This
fixes removing destination directory in dav module, as caught by dav.t.
The ngx_close_dir() function introduced to properly convert errors, as
FindClose() returns 0 on error.

11 years agoUpdated PCRE used for win32 builds.
Maxim Dounin [Fri, 4 Jul 2014 18:34:03 +0000 (22:34 +0400)]
Updated PCRE used for win32 builds.

11 years agoSSL: logging level of "peer closed connection in SSL handshake".
Maxim Dounin [Fri, 4 Jul 2014 18:14:36 +0000 (22:14 +0400)]
SSL: logging level of "peer closed connection in SSL handshake".

Previously, the NGX_LOG_INFO level was used unconditionally.  This is
correct for client SSL connections, but too low for connections to
upstream servers.  To resolve this, ngx_connection_error() now used
to log this error, it will select logging level appropriately.

With this change, if an upstream connection is closed during SSL
handshake, it is now properly logged at "error" level.

11 years agoUpstream: p->downstream_error instead of closing connection.
Maxim Dounin [Fri, 4 Jul 2014 16:47:16 +0000 (20:47 +0400)]
Upstream: p->downstream_error instead of closing connection.

Previously, nginx closed client connection in cases when a response body
from upstream was needed to be cached or stored but shouldn't be sent to
the client.  While this is normal for HTTP, it is unacceptable for SPDY.

Fix is to use instead the p->downstream_error flag to prevent nginx from
sending anything downstream.  To make this work, the event pipe code was
modified to properly cache empty responses with the flag set.

11 years agoUpstream: fixed handling of write event after sending request.
Valentin Bartenev [Tue, 1 Jul 2014 16:52:08 +0000 (20:52 +0400)]
Upstream: fixed handling of write event after sending request.

The ngx_http_upstream_dummy_handler() must be set regardless of
the read event state.  This prevents possible additional call of
ngx_http_upstream_send_request_handler().

11 years agoSSL: the "ssl_password_file" directive.
Valentin Bartenev [Mon, 16 Jun 2014 15:43:25 +0000 (19:43 +0400)]
SSL: the "ssl_password_file" directive.

11 years agoConfigure: restored "nginx/" missed in 6e4bb1d6679d.
Maxim Dounin [Thu, 26 Jun 2014 01:08:59 +0000 (05:08 +0400)]
Configure: restored "nginx/" missed in 6e4bb1d6679d.

11 years agoCore: removed meaningless check from ngx_palloc_block().
Maxim Dounin [Wed, 25 Jun 2014 23:34:19 +0000 (03:34 +0400)]
Core: removed meaningless check from ngx_palloc_block().

The check became meaningless after refactoring in 2a92804f4109.
With the loop currently in place, "current" can't be NULL, hence
the check can be dropped.

Additionally, the local variable "current" was removed to
simplify code, and pool->current now used directly instead.

Found by Coverity (CID 714236).