summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-15 11:19:27 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-04-15 11:19:27 +0000
commitc796dd263a5fd057b7f79e5782a3ac72f7e76910 (patch)
treebfdeb54165821dcd660ec8b690bd0f1376454f8b /src
parente41e7247261d98175f71c9362dd0878544177177 (diff)
downloadnginx-c796dd263a5fd057b7f79e5782a3ac72f7e76910.tar.gz
nginx-c796dd263a5fd057b7f79e5782a3ac72f7e76910.tar.bz2
shutdown client connection for cacheable header only responses
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_upstream.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 68b4d5a39..74de6710e 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1830,11 +1830,20 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
return;
}
+ c = r->connection;
+
if (r->header_only) {
+
if (u->cacheable || u->store) {
+
+ if (ngx_shutdown_socket(c->fd, NGX_WRITE_SHUTDOWN) == -1) {
+ ngx_connection_error(c, ngx_socket_errno,
+ ngx_shutdown_socket_n " failed");
+ }
+
r->read_event_handler = ngx_http_request_empty_handler;
r->write_event_handler = ngx_http_request_empty_handler;
- r->connection->error = 1;
+ c->error = 1;
} else {
ngx_http_upstream_finalize_request(r, u, rc);
@@ -1849,8 +1858,6 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
r->request_body->temp_file->file.fd = NGX_INVALID_FILE;
}
- c = r->connection;
-
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
if (!u->buffering) {