Fixed and improved the "*_bind" directives of proxying modules.

The "proxy_bind", "fastcgi_bind", "uwsgi_bind", "scgi_bind" and
"memcached_bind" directives are now inherited; inherited value
can be reset by the "off" parameter.  Duplicate directives are
now detected.  Parameter value can now contain variables.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5009 73f98a42-aea0-e011-b76d-00259023448c
Version bump.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5010 73f98a42-aea0-e011-b76d-00259023448c
Variables $pipe, $request_length, $time_iso8601, and $time_local.

Log module counterparts are preserved for efficiency.

Based on patch by Kiril Kalchev.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5011 73f98a42-aea0-e011-b76d-00259023448c
Removed redundant variable assignment.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5012 73f98a42-aea0-e011-b76d-00259023448c
Proxy: fixed proxy_method to always add space.

Before the patch if proxy_method was specified at http{} level the code
to add trailing space wasn't executed, resulting in incorrect requests
to upstream.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5013 73f98a42-aea0-e011-b76d-00259023448c
Configure: fixed style of include directories.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5014 73f98a42-aea0-e011-b76d-00259023448c
Configure: fixed GeoIP library detection.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5015 73f98a42-aea0-e011-b76d-00259023448c
GeoIP: IPv6 support.

When using IPv6 databases, IPv4 addresses are looked up as IPv4-mapped
IPv6 addresses.

Mostly based on a patch by Gregor Kališnik (ticket #250).


git-svn-id: svn://svn.nginx.org/nginx/trunk@5016 73f98a42-aea0-e011-b76d-00259023448c
Events: fixed null pointer dereference with resolver and poll.

A POLLERR signalled by poll() without POLLIN/POLLOUT, as seen on
Linux, would generate both read and write events, but there's no
write event handler for resolver events.  A fix is to only call
event handler of an active event.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5017 73f98a42-aea0-e011-b76d-00259023448c
Secure_link: fixed configuration inheritance.

The "secure_link_secret" directive was always inherited from the outer
configuration level even when "secure_link" and "secure_link_md5" were
specified on the inner level.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5018 73f98a42-aea0-e011-b76d-00259023448c
SSL: removed conditions that always hold true.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5019 73f98a42-aea0-e011-b76d-00259023448c
SSL: resetting of flush flag after the data was written.

There is no need to flush next chunk of data if it does not contain a buffer
with the flush or last_buf flags set.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5020 73f98a42-aea0-e011-b76d-00259023448c
SSL: preservation of flush flag for buffered data.

Previously, if SSL buffer was not sent we lost information that the data
must be flushed.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5021 73f98a42-aea0-e011-b76d-00259023448c
SSL: calculation of buffer size moved closer to its usage.

No functional changes.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5022 73f98a42-aea0-e011-b76d-00259023448c
SSL: avoid calling SSL_write() with zero data size.

According to documentation, calling SSL_write() with num=0 bytes to be sent
results in undefined behavior.

We don't currently call ngx_ssl_send_chain() with empty chain and buffer.
This check handles the case of a chain with total data size that is
a multiple of NGX_SSL_BUFSIZE, and with the special buffer at the end.

In practice such cases resulted in premature connection close and critical
error "SSL_write() failed (SSL:)" in the error log.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5023 73f98a42-aea0-e011-b76d-00259023448c
SSL: take into account data in the buffer while limiting output.

In some rare cases this can result in a more smooth sending rate.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5024 73f98a42-aea0-e011-b76d-00259023448c
SSL: fixed ngx_ssl_handshake() with level-triggered event methods.

Missing calls to ngx_handle_write_event() and ngx_handle_read_event()
resulted in a CPU hog during SSL handshake if an level-triggered event
method (e.g. select) was used.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5025 73f98a42-aea0-e011-b76d-00259023448c
Request body: fixed client_body_in_file_only.

After introduction of chunked request body reading support in 1.3.9 (r4931),
the rb->bufs wasn't set if request body was fully preread while calling the
ngx_http_read_client_request_body() function.

Reported by Yichun Zhang (agentzh).


git-svn-id: svn://svn.nginx.org/nginx/trunk@5026 73f98a42-aea0-e011-b76d-00259023448c
FastCGI: fixed wrong connection close with fastcgi_keep_conn.

With fastcgi_keep_conn it was possible that connection was closed after
FCGI_STDERR record with zero padding and without any further data read yet.
This happended as f->state was set to ngx_http_fastcgi_st_padding and then
"break" happened, resulting in p->length being set to f->padding, i.e. 0
(which in turn resulted in connection close).

Fix is to make sure we continue the loop after f->state is set.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5027 73f98a42-aea0-e011-b76d-00259023448c
FastCGI: unconditional state transitions.

Checks for f->padding before state transitions make code hard to follow,
remove them and make sure we always do another loop iteration after
f->state is set to ngx_http_fastcgi_st_padding.


git-svn-id: svn://svn.nginx.org/nginx/trunk@5028 73f98a42-aea0-e011-b76d-00259023448c