diff options
author | nginx <nginx@nginx.org> | 2013-09-17 13:36:21 +0000 |
---|---|---|
committer | Jon Kolb <jon@b0g.us> | 2013-09-17 13:36:21 +0000 |
commit | c6e358d8a8b9773f4244cca3fb0f4dff1a93c838 (patch) | |
tree | d521395e241ea7525b0743b76c97913319c6fda8 /src/http/ngx_http_request.c | |
parent | b4f0587460c1cec132bbf547b658057a674aa94e (diff) | |
download | nginx-1.5.5.tar.gz |
Changes with nginx 1.5.5 17 Sep 2013v1.5.5
*) Change: now nginx assumes HTTP/1.0 by default if it is not able to
detect protocol reliably.
*) Feature: the "disable_symlinks" directive now uses O_PATH on Linux.
*) Feature: now nginx uses EPOLLRDHUP events to detect premature
connection close by clients if the "epoll" method is used.
*) Bugfix: in the "valid_referers" directive if the "server_names"
parameter was used.
*) Bugfix: the $request_time variable did not work in nginx/Windows.
*) Bugfix: in the "image_filter" directive.
Thanks to Lanshun Zhou.
*) Bugfix: OpenSSL 1.0.1f compatibility.
Thanks to Piotr Sikora.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index ca738cbb6..1f6d246bc 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -571,6 +571,7 @@ ngx_http_create_request(ngx_connection_t *c) r->start_msec = tp->msec; r->method = NGX_HTTP_UNKNOWN; + r->http_version = NGX_HTTP_VERSION_10; r->headers_in.content_length_n = -1; r->headers_in.keep_alive_n = -1; @@ -2693,6 +2694,33 @@ ngx_http_test_reading(ngx_http_request_t *r) #endif +#if (NGX_HAVE_EPOLLRDHUP) + + if ((ngx_event_flags & NGX_USE_EPOLL_EVENT) && rev->pending_eof) { + socklen_t len; + + rev->eof = 1; + c->error = 1; + + err = 0; + len = sizeof(ngx_err_t); + + /* + * BSDs and Linux return 0 and set a pending error in err + * Solaris returns -1 and sets errno + */ + + if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) + == -1) + { + err = ngx_errno; + } + + goto closed; + } + +#endif + n = recv(c->fd, buf, 1, MSG_PEEK); if (n == 0) { @@ -3342,10 +3370,15 @@ ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc) return; } - for (cln = r->cleanup; cln; cln = cln->next) { + cln = r->cleanup; + r->cleanup = NULL; + + while (cln) { if (cln->handler) { cln->handler(cln->data); } + + cln = cln->next; } #if (NGX_STAT_STUB) |