]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.3.28-RELEASE import release-0.3.28
authorIgor Sysoev <igor@sysoev.ru>
Thu, 16 Feb 2006 15:26:46 +0000 (15:26 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 16 Feb 2006 15:26:46 +0000 (15:26 +0000)
    *) Feature: the "restrict_host_names" directive was canceled.

    *) Feature: the --with-cpu-opt=ppc64 configuration parameter.

    *) Bugfix: on some condition the proxied connection with a client was
       terminated prematurely.
       Thanks to Vladimir Shutoff.

    *) Bugfix: the "X-Accel-Limit-Rate" header line was not taken into
       account if the request was redirected using the "X-Accel-Redirect"
       header line.

    *) Bugfix: the "post_action" directive ran only after a successful
       completion of a request.

    *) Bugfix: the proxied response body generated by the "post_action"
       directive was transferred to a client.

18 files changed:
auto/cc/gcc
auto/options
docs/xml/nginx/changes.xml
src/core/nginx.h
src/core/ngx_string.c
src/event/ngx_event_pipe.c
src/http/modules/ngx_http_empty_gif_module.c
src/http/modules/ngx_http_referer_module.c
src/http/modules/perl/nginx.xs
src/http/ngx_http.c
src/http/ngx_http_core_module.c
src/http/ngx_http_core_module.h
src/http/ngx_http_request.c
src/http/ngx_http_request.h
src/http/ngx_http_special_response.c
src/http/ngx_http_upstream.c
src/os/unix/ngx_atomic.h
src/os/win32/ngx_win32_config.h

index 21a73406e9c68e08e1d9ddd954aa8bc98f8e81da..96ea865b8d8a620013d2bc4dfbc514eeac17f249 100644 (file)
@@ -101,6 +101,16 @@ case $CPU in
         NGX_CPU_CACHE_LINE=64
     ;;
 
+    ppc64)
+        # build 64-bit PowerPC binary
+        CPU_OPT="-m64"
+        CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
+        CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
+        CORE_LINK="$CORE_LINK -m64"
+        CC_AUX_FLAGS="$CC_AUX_FLAGS -m64"
+        NGX_CPU_CACHE_LINE=128
+    ;;
+
 esac
 
 
index 2f4be623c2265e43fe0b2a8bcfed58c67338bba3..4ff11000cf12c9863706541f096b31b92a57dea6 100644 (file)
@@ -267,7 +267,8 @@ cat << END
   --with-cc-opt=OPTIONS              set additional options for C compiler
   --with-ld-opt=OPTIONS              set additional options for linker
   --with-cpu-opt=CPU                 build for specified CPU, the valid values:
-                                     pentium, pentiumpro, pentium4, sparc64
+                                     pentium, pentiumpro, pentium3, pentium4,
+                                     athlon, opteron, sparc32, sparc64, ppc64
 
   --without-pcre                     disable PCRE libarary usage
   --with-pcre=DIR                    set path to PCRE library sources
index 93cfaecdc8782f121a17ce3e624296ed5f657a00..b04aa93fad166be31a26268f633af93a6f61d617 100644 (file)
@@ -9,6 +9,73 @@
 <title lang="en">nginx changelog</title>
 
 
+<changes ver="0.3.28" date="16.02.2006">
+
+<change type="feature">
+<para lang="ru">
+ÄÉÒÅËÔÉ×Á restrict_host_names ÕÐÒÁÚÄÎÅÎÁ.
+</para>
+<para lang="en">
+the "restrict_host_names" directive is canceled.
+</para>
+</change>
+
+<change type="feature">
+<para lang="ru">
+ÐÁÒÁÍÅÔÒ ËÏÎÆÉÇÕÒÁÃÉÉ --with-cpu-opt=ppc64.
+</para>
+<para lang="en">
+the --with-cpu-opt=ppc64 configuration parameter.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÐÒÉ ÎÅËÏÔÏÒÙÈ ÕÓÌÏ×ÉÑÈ ÐÒÏËÓÉÒÏ×ÁÎÎÏÅ ÓÏÅÄÉÎÅÎÉÅ Ó ËÌÉÅÎÔÏÍ ÚÁ×ÅÒÛÁÌÏÓØ
+ÐÒÅÖÄÅ×ÒÅÍÅÎÎÏ.
+óÐÁÓÉÂÏ ÷ÌÁÄÉÍÉÒÕ ûÕÔÏ×Õ.
+</para>
+<para lang="en">
+on some condition the proxied connection with a client was terminated
+prematurely.
+Thanks to Vladimir Shutoff.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÓÔÒÏËÁ ÚÁÇÏÌÏ×ËÁ "X-Accel-Limit-Rate" ÎÅ ÕÞÉÔÙ×ÁÌÁÓØ ÄÌÑ ÚÁÐÒÏÓÏ×,
+ÐÅÒÅÎÁÐÒÁ×ÌÅÎÎÙÈ Ó ÐÏÍÏÝØÀ ÓÔÒÏËÉ "X-Accel-Redirect".
+</para>
+<para lang="en">
+the "X-Accel-Limit-Rate" header line was not taken into account
+if the request was redirected using the "X-Accel-Redirect" header line.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÄÉÒÅËÔÉ×Á post_action ÒÁÂÏÔÁÌÁ ÔÏÌØËÏ ÐÏÓÌÅ ÕÓÐÅÛÎÏÇÏ ÚÁ×ÅÒÛÅÎÉÑ ÚÁÐÒÏÓÁ.
+</para>
+<para lang="en">
+the "post_action" directive ran only after a successful completion of a request.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÔÅÌÏ ÐÒÏËÓÉÒÏ×ÁÎÎÏÇÏ ÏÔ×ÅÔÁ, ÓÏÚÄÁ×ÁÅÍÏÇÏ ÄÉÒÅËÔÉ×ÏÊ post_action,
+ÐÅÒÅÄÁ×ÁÌÏÓØ ËÌÉÅÎÔÕ.
+</para>
+<para lang="en">
+the proxied response body generated by the "post_action" directive
+was transferred to a client.
+</para>
+</change>
+
+</changes>
+
+
 <changes ver="0.3.27" date="08.02.2006">
 
 <change type="change">
index 74ba8095db1fc8135e5bdf7379600609d58fc416..5adb47d1f6f5d4dad845d2fb206b93b3e04cf738 100644 (file)
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VER          "nginx/0.3.27"
+#define NGINX_VER          "nginx/0.3.28"
 
 #define NGINX_VAR          "NGINX"
 #define NGX_OLDPID_EXT     ".oldbin"
index c99778d87dc1a27defbd8ca09a6c0227acd6a6c2..6a81984dd910a7a303b62f633c173cd0a934b00d 100644 (file)
@@ -312,7 +312,7 @@ ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
                 hexadecimal = 2;
                 sign = 0;
                 zero = '0';
-                width = 8;
+                width = NGX_PTR_SIZE * 2;
                 break;
 
             case 'c':
index ffb7929dd9b3f0a29b3a9ee9f751152a21278637..09b6f6a6e5704bf174c9e69a43c9896485eadb1c 100644 (file)
@@ -60,8 +60,11 @@ ngx_event_pipe(ngx_event_pipe_t *p, int do_write)
             return NGX_ABORT;
         }
 
-        if (rev->active) {
+        if (rev->active && !rev->ready) {
             ngx_add_timer(rev, p->read_timeout);
+
+        } else if (rev->timer_set) {
+            ngx_del_timer(rev);
         }
     }
 
@@ -71,8 +74,13 @@ ngx_event_pipe(ngx_event_pipe_t *p, int do_write)
             return NGX_ABORT;
         }
 
-        if (wev->active && !wev->ready && !wev->delayed) {
-            ngx_add_timer(wev, p->send_timeout);
+        if (!wev->delayed) {
+            if (wev->active && !wev->ready) {
+                ngx_add_timer(wev, p->send_timeout);
+
+            } else if (wev->timer_set) {
+                ngx_del_timer(wev);
+            }
         }
     }
 
index c7af1214c3259eb7cbbc42d5d8253ae365289700..d72983ad436cfda0343eaee6c0326b5401f96bd1 100644 (file)
@@ -148,7 +148,7 @@ ngx_http_empty_gif_handler(ngx_http_request_t *r)
     b->last_buf = 1;
 
     r->headers_out.status = NGX_HTTP_OK;
-    r->headers_out.content_length_n = b->last - b->pos;
+    r->headers_out.content_length_n = sizeof(ngx_empty_gif);
     r->headers_out.last_modified_time = 23349600;
 
     rc = ngx_http_send_header(r);
index 4eac263a928a9be358770d712634a2df03897188..3ad419b39f3bfcd8cc3e4506caec5af9cba83c25 100644 (file)
@@ -334,6 +334,7 @@ ngx_http_valid_referers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         }
 
         uri.len = 0;
+        uri.data = NULL;
 
         if (ngx_strcmp(value[i].data, "server_names") == 0) {
 
index c24788c70e2fb81d67368b6c2ba6e2a6b3ce6986..2d7ede0318e2785adbe5fb07dc9823c7659e52fb 100644 (file)
@@ -415,9 +415,11 @@ print(r, ...)
 
 
 int
-sendfile(r, filename)
+sendfile(r, filename, offset = -1, bytes = 0)
     nginx                     r
     char                     *filename
+    int                       offset;
+    size_t                    bytes;
 
     PREINIT:
 
@@ -460,17 +462,26 @@ sendfile(r, filename)
         goto done;
     }
 
-    if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) {
-        ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
-                      ngx_fd_info_n " \"%s\" failed", filename);
+    if (offset == -1) {
+        offset = 0;
+    }
+
+    if (bytes == 0) {
+        if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) {
+            ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
+                          ngx_fd_info_n " \"%s\" failed", filename);
+
+            if (ngx_close_file(fd) == NGX_FILE_ERROR) {
+                ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
+                              ngx_close_file_n " \"%s\" failed", filename);
+            }
+
+            RETVAL = NGX_ERROR;
+            goto done;
 
-        if (ngx_close_file(fd) == NGX_FILE_ERROR) {
-            ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
-                          ngx_close_file_n " \"%s\" failed", filename);
         }
 
-        RETVAL = NGX_ERROR;
-        goto done;
+        bytes = ngx_file_size(&fi) - offset;
     }
 
     cln->handler = ngx_pool_cleanup_file;
@@ -481,8 +492,9 @@ sendfile(r, filename)
     clnf->log = r->pool->log;
 
     b->in_file = 1;
-    b->file_pos = 0;
-    b->file_last = ngx_file_size(&fi);
+
+    b->file_pos = offset;
+    b->file_last = offset + bytes;
 
     b->file->fd = fd;
     b->file->log = r->connection->log;
index 6211f0e1e0b66ff9b166c6a7aa50d4e7276927d5..7f19a43478c818fcfce98725c7596bab95ba6e64 100644 (file)
@@ -534,7 +534,6 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         /*
          * check whether all name-based servers have the same configuraiton
          *     as the default server,
-         * or some servers restrict the host names,
          * or some servers disable optimizing the server names
          */
 
@@ -545,9 +544,7 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             for (s = 0; s < in_addr[a].names.nelts; s++) {
 
                 if (in_addr[a].core_srv_conf != name[s].core_srv_conf
-                    || name[s].core_srv_conf->optimize_server_names == 0
-                    || name[s].core_srv_conf->restrict_host_names
-                       != NGX_HTTP_RESTRICT_HOST_OFF)
+                    || name[s].core_srv_conf->optimize_server_names == 0)
                 {
                     goto virtual_names;
                 }
@@ -556,7 +553,6 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             /*
              * if all name-based servers have the same configuration
              *         as the default server,
-             *     and no servers restrict the host names,
              *     and no servers disable optimizing the server names
              * then we do not need to check them at run-time at all
              */
index 1bc43dec0a35976ff786ee417086be0678f04b18..da142c381a8621fd50df06bcf5cdf391be7e79d8 100644 (file)
@@ -67,14 +67,6 @@ static ngx_conf_deprecated_t  ngx_conf_deprecated_optimize_host_names = {
 };
 
 
-static ngx_conf_enum_t  ngx_http_restrict_host_names[] = {
-    { ngx_string("off"), NGX_HTTP_RESTRICT_HOST_OFF },
-    { ngx_string("on"), NGX_HTTP_RESTRICT_HOST_ON },
-    { ngx_string("close"), NGX_HTTP_RESTRICT_HOST_CLOSE },
-    { ngx_null_string, 0 }
-};
-
-
 static ngx_command_t  ngx_http_core_commands[] = {
 
     { ngx_string("variables_hash_max_size"),
@@ -147,13 +139,6 @@ static ngx_command_t  ngx_http_core_commands[] = {
       offsetof(ngx_http_core_srv_conf_t, large_client_header_buffers),
       NULL },
 
-    { ngx_string("restrict_host_names"),
-      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
-      ngx_conf_set_enum_slot,
-      NGX_HTTP_SRV_CONF_OFFSET,
-      offsetof(ngx_http_core_srv_conf_t, restrict_host_names),
-      &ngx_http_restrict_host_names },
-
     { ngx_string("optimize_server_names"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
       ngx_conf_set_flag_slot,
@@ -747,7 +732,9 @@ ngx_http_update_location_config(ngx_http_request_t *r)
         r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
     }
 
-    r->limit_rate = clcf->limit_rate;
+    if (r->limit_rate == 0) {
+        r->limit_rate = clcf->limit_rate;
+    }
 
     if (clcf->handler) {
         r->content_handler = clcf->handler;
@@ -1879,7 +1866,6 @@ ngx_http_core_create_srv_conf(ngx_conf_t *cf)
     cscf->request_pool_size = NGX_CONF_UNSET_SIZE;
     cscf->client_header_timeout = NGX_CONF_UNSET_MSEC;
     cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
-    cscf->restrict_host_names = NGX_CONF_UNSET_UINT;
     cscf->optimize_server_names = NGX_CONF_UNSET;
     cscf->ignore_invalid_headers = NGX_CONF_UNSET;
 
@@ -1965,9 +1951,6 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         return NGX_CONF_ERROR;
     }
 
-    ngx_conf_merge_unsigned_value(conf->restrict_host_names,
-                              prev->restrict_host_names, 0);
-
     ngx_conf_merge_value(conf->optimize_server_names,
                               prev->optimize_server_names, 1);
 
index 6d815a7cce1b3a333da81e33ffe1802eb3f53846..9f5b65c967bea029dd8d2cf827e176e1b8a7e69c 100644 (file)
@@ -112,8 +112,6 @@ typedef struct {
 
     ngx_msec_t                 client_header_timeout;
 
-    ngx_uint_t                 restrict_host_names;
-
     ngx_flag_t                 optimize_server_names;
     ngx_flag_t                 ignore_invalid_headers;
 } ngx_http_core_srv_conf_t;
index aa2b85f92c21ba56a6f4720c755824d00d699ab2..b97515cc3ce0bffcdc4e358f5de65badd12c37e2 100644 (file)
@@ -25,7 +25,7 @@ static ngx_int_t ngx_http_process_cookie(ngx_http_request_t *r,
     ngx_table_elt_t *h, ngx_uint_t offset);
 
 static ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_find_virtual_server(ngx_http_request_t *r);
+static void ngx_http_find_virtual_server(ngx_http_request_t *r);
 
 static void ngx_http_request_handler(ngx_event_t *ev);
 static ngx_int_t ngx_http_set_write_handler(ngx_http_request_t *r);
@@ -39,6 +39,7 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r);
 static void ngx_http_keepalive_handler(ngx_event_t *ev);
 static void ngx_http_set_lingering_close(ngx_http_request_t *r);
 static void ngx_http_lingering_close_handler(ngx_event_t *ev);
+static ngx_int_t ngx_http_post_action(ngx_http_request_t *r);
 static void ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error);
 static void ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error);
 static void ngx_http_close_connection(ngx_connection_t *c);
@@ -1164,9 +1165,8 @@ ngx_http_process_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
 static ngx_int_t
 ngx_http_process_request_header(ngx_http_request_t *r)
 {
-    size_t                      len;
-    u_char                     *ua, *user_agent, ch;
-    ngx_http_core_srv_conf_t   *cscf;
+    size_t   len;
+    u_char  *ua, *user_agent, ch;
 
     if (r->headers_in.host) {
         for (len = 0; len < r->headers_in.host->value.len; len++) {
@@ -1185,20 +1185,7 @@ ngx_http_process_request_header(ngx_http_request_t *r)
 
         r->headers_in.host_name_len = len;
 
-        if (ngx_http_find_virtual_server(r) != NGX_OK) {
-            ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
-                          "client sent invalid \"Host\" header");
-
-            cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
-            if (cscf->restrict_host_names == NGX_HTTP_RESTRICT_HOST_CLOSE) {
-                ngx_http_close_request(r, NGX_HTTP_BAD_REQUEST);
-                return NGX_ERROR;
-            }
-
-            ngx_http_finalize_request(r, NGX_HTTP_INVALID_HOST);
-            return NGX_ERROR;
-        }
+        ngx_http_find_virtual_server(r);
 
     } else {
         if (r->http_version > NGX_HTTP_VERSION_10) {
@@ -1316,7 +1303,7 @@ ngx_http_process_request_header(ngx_http_request_t *r)
 }
 
 
-static ngx_int_t
+static void
 ngx_http_find_virtual_server(ngx_http_request_t *r)
 {
     size_t                     len;
@@ -1328,7 +1315,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r)
     vn = r->virtual_names;
 
     if (vn == NULL) {
-        return NGX_OK;
+        return;
     }
 
     host = r->headers_in.host->value.data;
@@ -1351,13 +1338,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r)
         }
     }
 
-    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
-    if (cscf->restrict_host_names == NGX_HTTP_RESTRICT_HOST_OFF) {
-        return NGX_OK;
-    }
-
-    return NGX_ERROR;
+    return;
 
 found:
 
@@ -1374,7 +1355,7 @@ found:
         r->connection->log->log_level = clcf->err_log->log_level;
     }
 
-    return NGX_OK;
+    return;
 }
 
 
@@ -1411,7 +1392,15 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
                    "http finalize request: %d, \"%V?%V\"",
                    rc, &r->uri, &r->args);
 
-    if (rc == NGX_ERROR || r->connection->error) {
+    if (rc == NGX_ERROR
+        || rc == NGX_HTTP_REQUEST_TIME_OUT
+        || r->connection->error)
+    {
+
+        if (ngx_http_post_action(r) == NGX_OK) {
+            return;
+        }
+
         ngx_http_close_request(r, 0);
         return;
     }
@@ -1515,12 +1504,7 @@ 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) {
-        r->http_version = NGX_HTTP_VERSION_9;
-        r->header_only = 1;
-        ngx_http_internal_redirect(r, &clcf->post_action, NULL);
+    if (ngx_http_post_action(r) == NGX_OK) {
         return;
     }
 
@@ -1537,17 +1521,7 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
         return;
     }
 
-#if 0
-    if (r->connection->read->pending_eof) {
-#if (NGX_HAVE_KQUEUE)
-        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log,
-                       r->connection->read->kq_errno,
-                       "kevent() reported about an closed connection");
-#endif
-        ngx_http_close_request(r, 0);
-        return;
-    }
-#endif
+    clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
     if (!ngx_terminate
          && !ngx_exiting
@@ -1616,7 +1590,7 @@ ngx_http_writer(ngx_http_request_t *r)
                           "client timed out");
             c->timedout = 1;
 
-            ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
+            ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
             return;
         }
 
@@ -2265,7 +2239,27 @@ ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags)
 }
 
 
-void
+static ngx_int_t
+ngx_http_post_action(ngx_http_request_t *r)
+{
+    ngx_http_core_loc_conf_t  *clcf;
+
+    clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+
+    if (clcf->post_action.data == NULL) {
+        return NGX_DECLINED;
+    }
+
+    r->http_version = NGX_HTTP_VERSION_9;
+    r->header_only = 1;
+
+    ngx_http_internal_redirect(r, &clcf->post_action, NULL);
+
+    return NGX_OK;
+}
+
+
+static void
 ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
 {
     ngx_connection_t    *c;
@@ -2285,7 +2279,7 @@ ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
 }
 
 
-void
+static void
 ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error)
 {
     ngx_log_t                  *log;
index 9f4ae21a5f7163acc5d59d277cff8283e819fb6b..facd58ef6be9cda925156955f8cbaf2f2665bdcb 100644 (file)
  */
 #define NGX_HTTP_TO_HTTPS                  497
 
-/*
- * We use the special code for the requests with invalid host name
- * to distinguish it from 4XX in an error page redirection
- */
-#define NGX_HTTP_INVALID_HOST              498
+/* 498 is the canceled code for the requests with invalid host name */
 
 /*
  * HTTP does not define the code for the case when a client closed
 #define NGX_HTTP_COPY_BUFFERED             0x00000200
 
 
-typedef enum {
-    NGX_HTTP_RESTRICT_HOST_OFF = 0,
-    NGX_HTTP_RESTRICT_HOST_ON,
-    NGX_HTTP_RESTRICT_HOST_CLOSE
-} ngx_http_restrict_host_e;
-
-
 typedef enum {
     NGX_HTTP_INITING_REQUEST_STATE = 0,
     NGX_HTTP_READING_REQUEST_STATE,
index 63a3a349470d91fc23ca7a87f59d897bcef21fad..4bb42cdb9e39e57fbd7e587b74a0e0822ab3d161 100644 (file)
@@ -343,11 +343,6 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
                 r->headers_out.status = NGX_HTTP_BAD_REQUEST;
                 error = NGX_HTTP_BAD_REQUEST;
                 break;
-
-            case NGX_HTTP_INVALID_HOST:
-                r->headers_out.status = NGX_HTTP_NOT_FOUND;
-                error = NGX_HTTP_NOT_FOUND;
-                break;
         }
     }
 
index 9afa4d567b59a15de0b59c095e5099cc1ab796c8..cb552837121c40891e3deb7e7f39cf7a3e0c7ab9 100644 (file)
@@ -1209,7 +1209,10 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
 
     rc = ngx_http_send_header(r);
 
-    if (rc == NGX_ERROR || rc > NGX_OK) {
+    if (rc == NGX_ERROR
+        || rc > NGX_OK
+                          /* post_action */
+        || (r->http_version == NGX_HTTP_VERSION_9 && r->header_only)) {
         ngx_http_upstream_finalize_request(r, u, rc);
         return;
     }
index c505027fda997d2efbc14c125dfa5cd30482de93..79198262774cd9b8e1ee32e2a0fe3d1033992f74 100644 (file)
@@ -115,7 +115,7 @@ typedef volatile ngx_atomic_uint_t  ngx_atomic_t;
 #endif
 
 
-#elif ( __ppc__ || __powerpc__ )
+#elif ( __powerpc__ || __POWERPC__ )
 
 #define NGX_HAVE_ATOMIC_OPS  1
 
index f2c7a0665ed8488a2b9f46aa0869b096a7eebce1..8df05861083ebbd6bcae37045e345e7da39b2fe3 100644 (file)
@@ -125,6 +125,7 @@ typedef u_short           in_port_t;
 typedef int               sig_atomic_t;
 
 
+#define NGX_PTR_SIZE            4
 #define NGX_SIZE_T_LEN          sizeof("-2147483648") - 1
 #define NGX_MAX_SIZE_T_VALUE   2147483647
 #define NGX_TIME_T_LEN          sizeof("-2147483648") - 1