summaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-11-15 13:30:52 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-11-15 13:30:52 +0000
commit0e5dc5cff692f532f0ccb2655ab196995f4233e0 (patch)
treef56f40e788077b9820ebb45f3e0739fabb7be421 /src/http/ngx_http_request.c
parent2a7f83eceda87e520f36bbfb16b82b8c2d6606d7 (diff)
downloadnginx-release-0.3.10.tar.gz
nginx-0.3.10-RELEASE importrelease-0.3.10
*) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c43
1 files changed, 13 insertions, 30 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index ef5a45f56..a73c788b6 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -51,7 +51,6 @@ static u_char *ngx_http_log_error_handler(ngx_http_request_t *r, u_char *buf,
#if (NGX_HTTP_SSL)
static void ngx_http_ssl_handshake(ngx_event_t *rev);
static void ngx_http_ssl_handshake_handler(ngx_connection_t *c);
-static void ngx_http_ssl_close_handler(ngx_event_t *ev);
#endif
@@ -451,7 +450,7 @@ ngx_http_ssl_handshake(ngx_event_t *rev)
return;
}
- n = recv(c->fd, buf, 1, MSG_PEEK);
+ n = recv(c->fd, buf, 1, MSG_PEEK);
if (n == -1 && ngx_socket_errno == NGX_EAGAIN) {
return;
@@ -1346,7 +1345,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r)
}
if (rc < 0) {
- /* the server names are lexicographically sorted */
+ /* the server names are lexicographically sorted */
break;
}
}
@@ -1520,6 +1519,13 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
return;
}
+ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+
+ if (clcf->post_action.data) {
+ ngx_http_internal_redirect(r, &clcf->post_action, NULL);
+ return;
+ }
+
if (r->connection->read->timer_set) {
ngx_del_timer(r->connection->read);
}
@@ -1539,8 +1545,6 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
return;
}
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
if (!ngx_terminate
&& !ngx_exiting
&& r->keepalive != 0
@@ -1894,7 +1898,7 @@ ngx_http_set_keepalive(ngx_http_request_t *r)
* If the large header buffers were allocated while the previous
* request processing then we do not use c->buffer for
* the pipelined request (see ngx_http_init_request()).
- *
+ *
* Now we would move the large header buffers to the free list.
*/
@@ -2178,7 +2182,7 @@ ngx_http_keepalive_handler(ngx_event_t *rev)
static void
ngx_http_set_lingering_close(ngx_http_request_t *r)
-{
+{
ngx_event_t *rev, *wev;
ngx_connection_t *c;
ngx_http_core_loc_conf_t *clcf;
@@ -2248,6 +2252,7 @@ ngx_http_lingering_close_handler(ngx_event_t *rev)
"http lingering close handler");
if (rev->timedout) {
+ c->timedout = 1;
ngx_http_close_request(r, 0);
return;
}
@@ -2423,8 +2428,7 @@ ngx_http_close_connection(ngx_connection_t *c)
if (c->ssl) {
if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
- c->read->handler = ngx_http_ssl_close_handler;
- c->write->handler = ngx_http_ssl_close_handler;
+ c->ssl->handler = ngx_http_close_connection;
return;
}
}
@@ -2443,27 +2447,6 @@ ngx_http_close_connection(ngx_connection_t *c)
}
-#if (NGX_HTTP_SSL)
-
-static void
-ngx_http_ssl_close_handler(ngx_event_t *ev)
-{
- ngx_connection_t *c;
-
- c = ev->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0, "http ssl close handler");
-
- if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
- return;
- }
-
- ngx_http_close_connection(c);
-}
-
-#endif
-
-
static u_char *
ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len)
{