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
FastCGI: proper handling of split fastcgi end request.

If fastcgi end request record was split between several network packets,
with fastcgi_keep_conn it was possible that connection was saved in incorrect
state (e.g. with padding bytes not yet read).


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