nginx-0.1.1-RELEASE import
*) Feature: the gzip_types directive.
*) Feature: the tcp_nodelay directive.
*) Feature: the send_lowat directive is working not only on OSes that
support kqueue NOTE_LOWAT, but also on OSes that support SO_SNDLOWAT.
*) Feature: the setproctitle() emulation for Linux and Solaris.
*) Bugfix: the "Location" header rewrite bug fixed while the proxying.
*) Bugfix: the ngx_http_chunked_module module may get caught in an
endless loop.
*) Bugfix: the /dev/poll module bugs fixed.
*) Bugfix: the responses were corrupted when the temporary files were
used while the proxying.
*) Bugfix: the unescaped requests were passed to the backend.
*) Bugfix: while the build configuration on Linux 2.4 the
--with-poll_module parameter was required.
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index e889449..6069847 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -550,7 +550,7 @@
return;
}
- if (r->complex_uri) {
+ if (r->complex_uri || r->quoted_uri) {
rc = ngx_http_parse_complex_uri(r);
if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
@@ -1318,8 +1318,7 @@
ngx_add_timer(wev, clcf->send_timeout);
}
- wev->available = clcf->send_lowat;
- if (ngx_handle_write_event(wev, NGX_LOWAT_EVENT) == NGX_ERROR) {
+ if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
ngx_http_close_request(r, 0);
ngx_http_close_connection(r->connection);
}
@@ -1354,9 +1353,7 @@
ngx_http_core_module);
ngx_add_timer(wev, clcf->send_timeout);
- wev->available = clcf->send_lowat;
-
- if (ngx_handle_write_event(wev, NGX_LOWAT_EVENT) == NGX_ERROR) {
+ if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
ngx_http_close_request(r, 0);
ngx_http_close_connection(r->connection);
}
@@ -1371,9 +1368,8 @@
clcf = ngx_http_get_module_loc_conf(r->main ? r->main : r,
ngx_http_core_module);
- wev->available = clcf->send_lowat;
- if (ngx_handle_write_event(wev, NGX_LOWAT_EVENT) == NGX_ERROR) {
+ if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
ngx_http_close_request(r, 0);
ngx_http_close_connection(r->connection);
}
@@ -1394,9 +1390,7 @@
ngx_add_timer(wev, clcf->send_timeout);
}
- wev->available = clcf->send_lowat;
-
- if (ngx_handle_write_event(wev, NGX_LOWAT_EVENT) == NGX_ERROR) {
+ if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
ngx_http_close_request(r, 0);
ngx_http_close_connection(r->connection);
}
@@ -1541,6 +1535,7 @@
static void ngx_http_set_keepalive(ngx_http_request_t *r)
{
+ int tcp_nodelay;
ngx_int_t i;
ngx_buf_t *b, *f;
ngx_event_t *rev, *wev;
@@ -1684,7 +1679,26 @@
ngx_http_close_connection(c);
return;
}
+
c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
+
+ } else {
+ if (clcf->tcp_nodelay && !c->tcp_nodelay) {
+ tcp_nodelay = 1;
+
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
+
+ if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
+ (const void *) &tcp_nodelay, sizeof(int)) == -1)
+ {
+ ngx_connection_error(c, ngx_socket_errno,
+ "setsockopt(TCP_NODELAY) failed");
+ ngx_http_close_connection(c);
+ return;
+ }
+
+ c->tcp_nodelay = 1;
+ }
}
#if 0
@@ -2055,6 +2069,18 @@
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"close http connection: %d", c->fd);
+#if (NGX_OPENSSL)
+
+ if (c->ssl) {
+ if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
+ c->read->event_handler = ngx_ssl_close_handler;
+ c->write->event_handler = ngx_ssl_close_handler;
+ return;
+ }
+ }
+
+#endif
+
#if (NGX_STAT_STUB)
(*ngx_stat_active)--;
#endif