Commit Graph

4503 Commits

Author SHA1 Message Date
Maxim Dounin
23ddf14648 SSL: fixed $ssl_session_id variable.
Previously, it used to contain full session serialized instead of just
a session id, making it almost impossible to use the variable in a safe
way.

Thanks to Ivan Ristić.
2014-01-22 16:05:06 +04:00
Valentin Bartenev
6b949b3920 SPDY: fixed possible segfault.
While processing a DATA frame, the link to related stream is stored in spdy
connection object as part of connection state.  But this stream can be closed
between receiving parts of the frame.
2014-01-22 04:58:19 +04:00
Valentin Bartenev
ddc22dcb9c Year 2014. 2014-01-14 16:24:02 +04:00
Maxim Dounin
142ed3f499 Fixed "zero size buf in output" alerts.
If a request had an empty request body (with Content-Length: 0), and there
were preread data available (e.g., due to a pipelined request in the buffer),
the "zero size buf in output" alert might be logged while proxying the
request to an upstream.

Similar alerts appeared with client_body_in_file_only if a request had an
empty request body.
2014-01-04 03:32:22 +04:00
Maxim Dounin
ae341c36ab Request body: fixed r->count increment on allocation failure. 2013-05-11 18:49:19 +04:00
Maxim Dounin
79f0766f35 SSL: fixed c->read->ready handling in ngx_ssl_recv().
If c->read->ready was reset, but later some data were read from a socket
buffer due to a call to ngx_ssl_recv(), the c->read->ready flag should
be restored if not all data were read from OpenSSL buffers (as kernel
won't notify us about the data anymore).

More details are available here:
http://mailman.nginx.org/pipermail/nginx/2013-November/041178.html
2013-11-29 17:16:06 +04:00
Maxim Dounin
a2d1c5f3b7 Win32: plugged memory leak. 2013-10-31 18:23:49 +04:00
Maxim Dounin
97a782b045 Version bump. 2014-02-06 20:49:12 +04:00
Maxim Dounin
458cca890f release-1.4.4 tag 2013-11-19 15:25:24 +04:00
Maxim Dounin
37c4ed61ef nginx-1.4.4-RELEASE 2013-11-19 15:25:24 +04:00
Ruslan Ermilov
822a148df5 Proper backtracking after space in a request line. 2013-11-19 06:57:58 +04:00
Maxim Dounin
491d3e76fc Version bump. 2013-11-19 15:23:03 +04:00
Maxim Dounin
41a1c0240e release-1.4.3 tag 2013-10-08 16:07:14 +04:00
Maxim Dounin
e6181edce3 nginx-1.4.3-RELEASE 2013-10-08 16:07:13 +04:00
Maxim Dounin
2638cef719 Mail: fixed segfault with ssl/starttls at mail{} level and no cert.
A configuration like "mail { starttls on; server {}}" triggered NULL
pointer dereference in ngx_mail_ssl_merge_conf() as conf->file was not set.
2013-09-30 22:10:13 +04:00
Maxim Dounin
9f97a0c4f9 Mail: fixed overrun of allocated memory (ticket #411).
Reported by Markus Linnala.
2013-09-30 22:10:08 +04:00
Markus Linnala
2554b2842c Core: fix misallocation at ngx_crypt_apr1 (ticket #412).
Found by using auth_basic.t from mdounin nginx-tests under valgrind.

==10470== Invalid write of size 1
==10470==    at 0x43603D: ngx_crypt_to64 (ngx_crypt.c:168)
==10470==    by 0x43648E: ngx_crypt (ngx_crypt.c:153)
==10470==    by 0x489D8B: ngx_http_auth_basic_crypt_handler (ngx_http_auth_basic_module.c:297)
==10470==    by 0x48A24A: ngx_http_auth_basic_handler (ngx_http_auth_basic_module.c:240)
==10470==    by 0x44EAB9: ngx_http_core_access_phase (ngx_http_core_module.c:1121)
==10470==    by 0x44A822: ngx_http_core_run_phases (ngx_http_core_module.c:895)
==10470==    by 0x44A932: ngx_http_handler (ngx_http_core_module.c:878)
==10470==    by 0x455EEF: ngx_http_process_request (ngx_http_request.c:1852)
==10470==    by 0x456527: ngx_http_process_request_headers (ngx_http_request.c:1283)
==10470==    by 0x456A91: ngx_http_process_request_line (ngx_http_request.c:964)
==10470==    by 0x457097: ngx_http_wait_request_handler (ngx_http_request.c:486)
==10470==    by 0x4411EE: ngx_epoll_process_events (ngx_epoll_module.c:691)
==10470==  Address 0x5866fab is 0 bytes after a block of size 27 alloc'd
==10470==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==10470==    by 0x43B251: ngx_alloc (ngx_alloc.c:22)
==10470==    by 0x421B0D: ngx_malloc (ngx_palloc.c:119)
==10470==    by 0x421B65: ngx_pnalloc (ngx_palloc.c:147)
==10470==    by 0x436368: ngx_crypt (ngx_crypt.c:140)
==10470==    by 0x489D8B: ngx_http_auth_basic_crypt_handler (ngx_http_auth_basic_module.c:297)
==10470==    by 0x48A24A: ngx_http_auth_basic_handler (ngx_http_auth_basic_module.c:240)
==10470==    by 0x44EAB9: ngx_http_core_access_phase (ngx_http_core_module.c:1121)
==10470==    by 0x44A822: ngx_http_core_run_phases (ngx_http_core_module.c:895)
==10470==    by 0x44A932: ngx_http_handler (ngx_http_core_module.c:878)
==10470==    by 0x455EEF: ngx_http_process_request (ngx_http_request.c:1852)
==10470==    by 0x456527: ngx_http_process_request_headers (ngx_http_request.c:1283)
==10470==
2013-09-20 17:57:21 +03:00
Maxim Dounin
8e69bbf44e Win32: $request_time fixed.
On win32, time_t is 64 bits wide by default, and passing an ngx_msec_int_t
argument for %T format specifier doesn't work.  This doesn't manifest itself
on other platforms as time_t and ngx_msec_int_t are usually of the same size.
2013-09-04 20:48:30 +04:00
Maxim Dounin
b5656b31f1 Fixed try_files with empty argument (ticket #390). 2013-08-23 22:18:39 +04:00
Sergey Kandaurov
6db33c712b Autoindex: improved ngx_de_info() error handling.
This allows to build a directory listing whenever a loop exists in symbolic
link resolution of the path argument.
2013-07-30 11:43:21 +04:00
Sergey Kandaurov
30091e8b38 Autoindex: return NGX_ERROR on error if headers were sent.
This prevents ngx_http_finalize_request() from issuing
ngx_http_special_response_handler() on a freed context.
2013-07-30 11:43:21 +04:00
Valentin Bartenev
6f05c095a8 SPDY: fixed segfault with "client_body_in_file_only" enabled.
It is possible to send FLAG_FIN in additional empty data frame, even if it is
known from the content-length header that request body is empty.  And Firefox
actually behaves like this (see ticket #357).

To simplify code we sacrificed our microoptimization that did not work right
due to missing check in the ngx_http_spdy_state_data() function for rb->buf
set to NULL.
2013-07-24 22:24:25 +04:00
Maxim Dounin
c32e9ab954 Version bump. 2013-10-07 20:30:03 +04:00
Maxim Dounin
8bff7901f9 release-1.4.2 tag 2013-07-17 16:51:21 +04:00
Maxim Dounin
4f72a78112 nginx-1.4.2-RELEASE 2013-07-17 16:51:21 +04:00
Maxim Dounin
4151983735 Perl: fixed r->header_in("Cookie") (ticket #351).
It was broken by X-Forwarded-For related changes in f7fe817c92a2 (1.3.14)
as hh->offset is no longer 0 for Cookie.
2013-06-10 14:35:00 +04:00
Maxim Dounin
35152b9c8d Updated zlib used for win32 builds. 2013-06-04 16:16:51 +04:00
Maxim Dounin
7dc6290ef6 Win32: accept_mutex now always disabled (ticket #362).
Use of accept mutex on win32 may result in a deadlock if there are multiple
worker_processes configured and the mutex is grabbed by a process which
can't accept connections.
2013-05-31 14:59:26 +04:00
Maxim Dounin
93b61fad80 Upstream: fixed fail_timeout and max_fails > 1.
Due to peer->checked always set since rev. c90801720a0c (1.3.0)
by round-robin and least_conn balancers (ip_hash not affected),
the code in ngx_http_upstream_free_round_robin_peer() function
incorrectly reset peer->fails too often.

Reported by Dmitry Popov,
http://mailman.nginx.org/pipermail/nginx-devel/2013-May/003720.html
2013-05-21 21:47:50 +04:00
Piotr Sikora
4ca32c31a0 OCSP stapling: fix error logging of successful OCSP responses.
Due to a bad argument list, nginx worker would crash (SIGSEGV) while
trying to log the fact that it received OCSP response with "revoked"
or "unknown" certificate status.

While there, fix similar (but non-crashing) error a few lines above.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-05-16 15:37:13 -07:00
Ruslan Ermilov
26dc3f37c3 Removed vestiges of SVN. 2013-04-25 17:41:45 +04:00
Maxim Dounin
307b617712 Proxy: $proxy_internal_body_length fixed.
The $proxy_internal_body_length value might change during request lifetime,
notably if proxy_set_body used, and use of a cached value might result in
incorrect upstream requests.

Patch by Lanshun Zhou.
2013-05-11 21:12:24 +04:00
Maxim Dounin
abef0366e9 Fixed build with --with-mail_ssl_module.
If nginx was compiled without --with-http_ssl_module, but with some
other module which uses OpenSSL (e.g. --with-mail_ssl_module), insufficient
preprocessor check resulted in build failure.  The problem was introduced
by e0a3714a36f8 (1.3.14).

Reported by Roman Arutyunyan.
2013-05-11 18:49:30 +04:00
Maxim Dounin
1901e10d19 Perl: extra "return" removed. 2013-05-11 18:48:56 +04:00
Maxim Dounin
8d096180d2 Version bump. 2013-07-12 14:24:07 +04:00
Maxim Dounin
ce489c0bd3 release-1.4.1 tag 2013-05-06 14:21:38 +04:00
Maxim Dounin
45b587fdc7 nginx-1.4.1-RELEASE 2013-05-06 14:20:27 +04:00
Maxim Dounin
4997de8005 Fixed chunk size parsing. 2013-05-06 14:03:24 +04:00
Maxim Dounin
243ecc69cd Version bump. 2013-05-06 14:18:46 +04:00
Maxim Dounin
a9b6b0c90a stable-1.4 branch 2013-05-06 02:12:30 +04:00
Maxim Dounin
3ee3e413c4 release-1.4.0 tag 2013-04-24 13:59:45 +00:00
Maxim Dounin
c869fd38f8 nginx-1.4.0-RELEASE 2013-04-24 13:59:34 +00:00
Maxim Dounin
39d9871bc8 Version bump. 2013-04-24 13:03:43 +00:00
Valentin Bartenev
670d42859d SPDY: set NGX_TCP_NODELAY_DISABLED for fake connections.
This is to avoid setting the TCP_NODELAY flag on SPDY socket in
ngx_http_upstream_send_response().  The latter works per request,
but in SPDY case it might affect other streams in connection.
2013-04-23 10:15:49 +00:00
Maxim Dounin
e584341792 Perl: request body handling fixed.
As of 1.3.9, chunked request body may be available with
r->headers_in.content_length_n <= 0.  Additionally, request body
may be in multiple buffers even if r->request_body_in_single_buf
was requested.
2013-04-23 10:04:12 +00:00
Maxim Dounin
9d4e3c3612 Configure: fixed perl Makefile generation (ticket #334).
Dependancy tracking introduced in r5169 were not handled absolute path
names properly.  Absolute names might appear in CORE_DEPS if --with-openssl
or --with-pcre configure arguments are used to build OpenSSL/PCRE
libraries.

Additionally, revert part of r5169 to set NGX_INCS from Makefile
variables.  Makefile variables have $ngx_include_opt in them, which
might result in wrong include paths being used.  As a side effect,
this also restores build with --with-http_perl_module and --without-http
at the same time.
2013-04-19 12:19:57 +00:00
Ruslan Ermilov
4352782879 Configure: uniformly refer to libs when searching for md5 and sha1. 2013-04-18 14:26:08 +00:00
Ruslan Ermilov
ba4f2702bc Version bump. 2013-04-18 14:16:44 +00:00
Maxim Dounin
f58466ed15 release-1.3.16 tag 2013-04-16 14:05:22 +00:00
Maxim Dounin
12bdaf6c2c nginx-1.3.16-RELEASE 2013-04-16 14:05:11 +00:00