Commit graph

4276 commits

Author SHA1 Message Date
Valentin Bartenev
16d884f6f8 Proxy: generic regex related code from the "proxy_redirect" directive moved
to a separate function.

No functional changes.
2012-02-13 11:00:08 +00:00
Valentin Bartenev
3171bf2ce3 Proxy: generic rewrite code from the "proxy_redirect" handlers moved to a
separate function with trivial optimization.

No functional changes.
2012-02-13 10:56:09 +00:00
Valentin Bartenev
f1dc99c4b9 Proxy: renamed some "proxy_redirect" related declarations to a more general and
reusable.

No functional changes.
2012-02-13 10:42:44 +00:00
Maxim Dounin
ddcad9e656 Upstream: fixed "too big header" check.
If header filter postponed processing of a header by returning NGX_AGAIN
and not moved u->buffer->pos, previous check incorrectly assumed there
is additional space and did another recv() with zero-size buffer.  This
resulted in "upstream prematurely closed connection" error instead
of correct "upstream sent too big header" one.

Patch by Feibo Li.
2012-02-10 14:31:04 +00:00
Valentin Bartenev
0f98c982d8 Added ngx_ncpu detection for most *nix platforms.
This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve
usage of the mutex lock optimization on multicore systems.
2012-02-10 11:24:19 +00:00
Valentin Bartenev
4736877982 Limit conn: returned to the old behavior of using the first actual limit on
the way.

It was unintentionally changed in r4272, so that it could only limit the first
location where the processing of the request has reached PREACCESS phase.
2012-02-10 10:48:58 +00:00
Valentin Bartenev
12ae1f6ff9 Fixed module name in comment. It was forgotten in r4281. 2012-02-10 09:56:37 +00:00
Maxim Dounin
8663c9d8b3 Version bump. 2012-02-09 16:18:02 +00:00
Maxim Dounin
aa38617773 release-1.1.14 tag 2012-01-30 13:52:35 +00:00
Maxim Dounin
32f33d6032 nginx-1.1.14-RELEASE 2012-01-30 13:52:10 +00:00
Maxim Dounin
31e1b6b491 Update OpenSSL and PCRE used for win32 builds. 2012-01-30 13:47:03 +00:00
Maxim Dounin
ac10152bbf Limit req: unbreak compilation with MSVC. 2012-01-30 13:19:25 +00:00
Valentin Bartenev
d167490e0a Fixed memory leak on HUP signal when PCRE JIT was used.
The PCRE JIT compiler uses mmap to allocate memory for its executable codes, so
we have to explicitly call the pcre_free_study() function to free this memory.
2012-01-30 12:53:57 +00:00
Valentin Bartenev
8b6fdbb161 Fixed proxy_redirect off inheritance.
Example configuration to reproduce:

  server {
      proxy_redirect off;

      location / {
          proxy_pass http://localhost:8000;
          proxy_redirect http://localhost:8000/ /;

          location ~ \.php$ {
              proxy_pass http://localhost:8000;
              # proxy_redirect must be inherited from the level above,
              # but instead it was switched off here
          }
      }
  }
2012-01-30 11:22:56 +00:00
Maxim Dounin
bd8324bb32 Fixed error handling in ngx_event_connect_peer().
Previously if ngx_add_event() failed a connection was freed two times (once
in the ngx_event_connect_peer(), and again by a caller) as pc->connection was
left set.  Fix is to always use ngx_close_connection() to close connection
properly and set pc->connection to NULL on errors.

Patch by Piotr Sikora.
2012-01-30 11:12:52 +00:00
Valentin Bartenev
4e156a3081 Limit req: support for multiple "limit_req" limits. 2012-01-30 10:17:56 +00:00
Valentin Bartenev
2beee3ded5 Limit req: number of cleanup calls reduced.
Doing a cleanup before every lookup seems to be too aggressive. It can lead to
premature removal of the nodes still usable, which increases the amount of work
under a mutex lock and therefore decreases performance.

In order to improve cleanup behavior, cleanup function call has been moved right
before the allocation of a new node.
2012-01-30 10:01:39 +00:00
Valentin Bartenev
903af93a2d Limit req: allocation and initialization of a new node moved to the lookup
function.

No functional changes.
2012-01-30 09:41:49 +00:00
Valentin Bartenev
3943b24350 Limit req: improved error handling when parsing "zone" parameter of
"limit_req_zone" directive; minimum size of zone is increased.

Previously an unsigned variable was used to keep the return value of
ngx_parse_size() function, which led to an incorrect zone size if NGX_ERROR
was returned.

The new code has been taken from the "limit_conn_zone" directive.
2012-01-30 09:26:08 +00:00
Valentin Bartenev
444d248d4c Limit req: error messages fixed. 2012-01-30 09:02:29 +00:00
Maxim Dounin
4759803fcd Fixed AIO error handling on FreeBSD.
The aio_return() must be called regardless of the error returned by
aio_error().  Not calling it resulted in various problems up to segmentation
faults (as AIO events are level-triggered and were reported again and again).

Additionally, in "aio sendfile" case r->blocked was incremented in case of
error returned from ngx_file_aio_read(), thus causing request hangs.
2012-01-30 07:39:47 +00:00
Maxim Dounin
a8362260c5 Removed ENGINE_load_builtin_engines() call.
It's already called by OPENSSL_config().  Calling it again causes some
openssl engines (notably GOST) to corrupt memory, as they don't expect
to be created more than once.
2012-01-30 07:38:27 +00:00
Valentin Bartenev
c67c399aba Fixed grammar in PCRE JIT error log message. 2012-01-24 10:20:42 +00:00
Maxim Konovalov
0330b7ef84 Copyright updated. 2012-01-18 15:07:43 +00:00
Maxim Konovalov
27418f6b88 Version bump. 2012-01-18 15:04:17 +00:00
Maxim Konovalov
2bad3828ce Version bump. 2012-01-18 14:33:17 +00:00
Ruslan Ermilov
1fdaac7c1b Fixed spelling. 2012-01-17 07:09:51 +00:00
Maxim Dounin
6181007a4b release-1.1.13 tag 2012-01-16 15:15:01 +00:00
Maxim Dounin
4025c3da41 nginx-1.1.13-RELEASE 2012-01-16 15:14:37 +00:00
Maxim Dounin
2a9140cb9f Updated OpenSSL version used for win32 build. 2012-01-16 15:10:36 +00:00
Igor Sysoev
3d0626aa0a 2012 year. 2012-01-16 14:31:15 +00:00
Valentin Bartenev
a07b39def4 Fixed division by zero exception in ngx_hash_init().
The ngx_hash_init() function did not expect call with zero elements count,
which caused FPE error on configs with an empty "types" block in http context
and "types_hash_max_size" > 10000.

Example configuration to reproduce:

  events { }

  http {
          types_hash_max_size 10001;
          types {}
          server {}
  }
2012-01-16 12:42:07 +00:00
Maxim Dounin
07400a51a0 Fixed sched_setaffinity(2) to correctly pass size.
Second argument (cpusetsize) is size in bytes, not in bits.  Previously
used constant 32 resulted in reading of uninitialized memory and caused
EINVAL to be returned on some Linux kernels.
2012-01-16 11:13:48 +00:00
Maxim Dounin
0a482a2731 Fixed handling of mp4 above 2G and 32bit offsets (ticket #84). 2012-01-16 11:03:27 +00:00
Maxim Dounin
b16574cc45 Fixed proxy_cache_use_stale in "no live upstreams" case. 2012-01-16 11:01:52 +00:00
Maxim Dounin
b929dfb429 Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.
Support for TLSv1.1 and TLSv1.2 protocols was introduced in OpenSSL 1.0.1
(-beta1 was recently released).  This change makes it possible to disable
these protocols and/or enable them without other protocols.
2012-01-11 11:15:00 +00:00
Maxim Dounin
95bbcfcfb0 Fixed limit_req burst/nodelay inheritance (ticket #76).
The problem was introduced in r4381 (1.1.12).
2012-01-11 11:09:05 +00:00
Valentin Bartenev
56b9f427e8 Fixed: proxy_redirect with regex might broke Refresh header.
The problem was localized in ngx_http_proxy_rewrite_redirect_regex() handler
function which did not take into account prefix when overwriting header value.
2012-01-10 15:09:45 +00:00
Ruslan Ermilov
de12e8a6ea Changed ngx_log_debugN() macros to verify the number of arguments
when built with debugging.
2012-01-10 07:28:32 +00:00
Valentin Bartenev
fcb581b929 Fixed configure with system PCRE library on Solaris.
The bug has been introduced in r4389.
2011-12-29 15:58:53 +00:00
Maxim Konovalov
8eb05fbc39 Some questionable optomizations flags for icc were removed
in order to simplify support of its future versions.
2011-12-29 15:36:07 +00:00
Maxim Dounin
9a4e6534ec Fixed punctuation. 2011-12-28 13:30:56 +00:00
Sergey Budnevitch
21d6f34287 libraries versions updated 2011-12-27 12:39:11 +00:00
Sergey Budnevitch
f8fd16fa5e zlib license file include fixed 2011-12-27 12:35:52 +00:00
Maxim Dounin
7d6f981a87 Version bump. 2011-12-27 11:56:48 +00:00
Maxim Dounin
59c811207a release-1.1.12 tag 2011-12-26 15:05:38 +00:00
Maxim Dounin
b4ba849348 nginx-1.1.12-RELEASE 2011-12-26 15:05:17 +00:00
Valentin Bartenev
498cc8846a Added support for regex study and PCRE JIT (ticket #41) optimizations on
configuration phase.
2011-12-26 13:10:36 +00:00
Maxim Dounin
2e6a0bc9a3 Fixed build without debug. 2011-12-26 11:33:11 +00:00
Maxim Dounin
01626586ef Cache lock support for fastcgi, scgi, uwsgi. 2011-12-26 11:16:19 +00:00