]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.3.29-RELEASE import release-0.3.29
authorIgor Sysoev <igor@sysoev.ru>
Mon, 20 Feb 2006 16:48:17 +0000 (16:48 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 20 Feb 2006 16:48:17 +0000 (16:48 +0000)
    *) Feature: now nginx uses less memory, if PHP in FastCGI mode sends
       many warnings before the response.

    *) Bugfix: the "Transfer-Encoding: chunked" header line was issued in
       the 204 responses for the HTTP/1.1 requests.

    *) Bugfix: nginx returned the 502 response, if the complete response
       header lines were transferred in a separate FastCGI records.

    *) Bugfix: if the proxied URI was specified in the "post_action"
       directive, then it ran only after a successful completion of a
       request.

docs/xml/nginx/changes.xml
src/core/nginx.h
src/event/ngx_event_accept.c
src/http/modules/ngx_http_chunked_filter_module.c
src/http/modules/ngx_http_fastcgi_module.c
src/http/ngx_http_request.c
src/http/ngx_http_upstream.c

index b04aa93fad166be31a26268f633af93a6f61d617..0460c930e127126a8023e45d37ef100a13d2b799 100644 (file)
@@ -9,6 +9,55 @@
 <title lang="en">nginx changelog</title>
 
 
+<changes ver="0.3.29" date="20.02.2006">
+
+<change type="feature">
+<para lang="ru">
+ÔÅÐÅÒØ nginx ÉÓÐÏÌØÚÕÅÔ ÍÅÎØÛÅ ÐÁÍÑÔÉ, ÅÓÌÉ PHP × ÒÅÖÉÍÅ FastCGI ÐÅÒÅÄÁ£Ô
+ÂÏÌØÛÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÒÅÄÕÐÒÅÖÄÅÎÉÊ ÐÅÒÅÄ ÏÔ×ÅÔÏÍ.
+</para>
+<para lang="en">
+now nginx uses less memory, if PHP in FastCGI mode sends many warnings
+before the response.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+× ÏÔ×ÅÔÁÈ 204 ÄÌÑ ÚÁÐÒÏÓÏ× ×ÅÒÓÉÉ HTTP/1.1 ×ÙÄÁ×ÁÌÁÓØ ÓÔÒÏËÁ ÚÁÇÏÌÏ×ËÁ
+"Transfer-Encoding: chunked".
+</para>
+<para lang="en">
+the "Transfer-Encoding: chunked" header line was issued in the 204 responses
+for the HTTP/1.1 requests.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+nginx ×ÏÚ×ÒÁÝÁÌ 502 ËÏÄ ÏÔ×ÅÔÁ, ÅÓÌÉ FastCGI ÓÅÒ×ÅÒ ÐÅÒÅÄÁ×ÁÌ ÐÏÌÎÙÅ ÓÔÒÏËÉ
+ÚÁÇÏÌÏ×ËÁ ÏÔ×ÅÔÁ × ÏÔÄÅÌØÎÙÈ FastCGI ÚÁÐÉÓÑÈ.
+</para>
+<para lang="en">
+nginx returned the 502 response, if the complete response header lines
+were transferred in a separate FastCGI records.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÅÓÌÉ × ÄÉÒÅËÔÉ×Å post_action ÂÙÌ ÕËÁÚÁΠÐÒÏËÓÉÒÕÅÍÙÊ URI, ÔÏ ÏΠ×ÙÐÏÌÎÑÌÓÑ
+ÔÏÌØËÏ ÐÏÓÌÅ ÕÓÐÅÛÎÏÇÏ ÚÁ×ÅÒÛÅÎÉÑ ÚÁÐÒÏÓÁ.
+</para>
+<para lang="en">
+if the proxied URI was specified in the "post_action" directive, then it ran
+only after a successful completion of a request.
+</para>
+</change>
+
+</changes>
+
+
 <changes ver="0.3.28" date="16.02.2006">
 
 <change type="feature">
index 5adb47d1f6f5d4dad845d2fb206b93b3e04cf738..01ce1bd936ad8a182a56e97f129d89a6d7f8c1e7 100644 (file)
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VER          "nginx/0.3.28"
+#define NGINX_VER          "nginx/0.3.29"
 
 #define NGINX_VAR          "NGINX"
 #define NGX_OLDPID_EXT     ".oldbin"
index 875c45d0e078ee782c02123fa0c3c632f59f8d5e..a795075d0fa92d70bc98cb6d45e88776ac7e1eb9 100644 (file)
@@ -264,8 +264,7 @@ ngx_trylock_accept_mutex(ngx_cycle_t *cycle)
         ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
                        "accept mutex locked");
 
-        if (ngx_accept_mutex_held && !(ngx_event_flags & NGX_USE_RTSIG_EVENT))
-        {
+        if (ngx_accept_mutex_held && !(ngx_event_flags & NGX_USE_RTSIG_EVENT)) {
             return NGX_OK;
         }
 
index 89c4a0429b025012eb7abbe59eb5c2aaba013ffe..d8d12088ceb50f3fc8b4bbc1148e1e998d6f88e6 100644 (file)
@@ -50,7 +50,10 @@ static ngx_http_output_body_filter_pt    ngx_http_next_body_filter;
 static ngx_int_t
 ngx_http_chunked_header_filter(ngx_http_request_t *r)
 {
-    if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED || r != r->main) {
+    if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED
+        || r->headers_out.status == NGX_HTTP_NO_CONTENT
+        || r != r->main)
+    {
         return ngx_http_next_header_filter(r);
     }
 
index 45b6e738259572a923fdaf684d2f9015cb6ef33b..978c325421fa9c31033444cc665ff8a578a14513 100644 (file)
@@ -46,7 +46,7 @@ typedef struct {
     size_t                     length;
     size_t                     padding;
 
-    ngx_uint_t                 header;
+    ngx_uint_t                 fastcgi_stdout;
 } ngx_http_fastcgi_ctx_t;
 
 
@@ -776,7 +776,7 @@ ngx_http_fastcgi_reinit_request(ngx_http_request_t *r)
     }
 
     f->state = ngx_http_fastcgi_st_version;
-    f->header = 0;
+    f->fastcgi_stdout = 0;
 
     return NGX_OK;
 }
@@ -876,13 +876,6 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
 
         if (f->type == NGX_HTTP_FASTCGI_STDERR) {
 
-            if (f->header) {
-                ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
-                              "upstream split a header in FastCGI records");
-
-                return NGX_HTTP_UPSTREAM_INVALID_HEADER;
-            }
-
             if (f->length) {
                 line.data = u->buffer.pos;
 
@@ -910,6 +903,18 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
                               "FastCGI sent in stderr: \"%V\"", &line);
 
                 if (u->buffer.pos == u->buffer.last) {
+
+                    if (!f->fastcgi_stdout) {
+
+                        /*
+                         * the special handling the large number
+                         * of the PHP warnings to not allocate memory
+                         */
+
+                        u->buffer.pos = u->buffer.start;
+                        u->buffer.last = u->buffer.start;
+                    }
+
                     return NGX_AGAIN;
                 }
 
@@ -923,6 +928,8 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
 
         /* f->type == NGX_HTTP_FASTCGI_STDOUT */
 
+        f->fastcgi_stdout = 1;
+
         start = u->buffer.pos;
 
         if (u->buffer.pos + f->length < u->buffer.last) {
@@ -939,8 +946,6 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
             last = NULL;
         }
 
-        f->header = 1;
-
         for ( ;; ) {
 
             rc = ngx_http_parse_header_line(r, &u->buffer);
@@ -991,7 +996,13 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
                                "http fastcgi header: \"%V: %V\"",
                                &h->key, &h->value);
 
-                continue;
+                if (u->buffer.pos < u->buffer.last) {
+                    continue;
+                }
+
+                /* the end of the FastCGI record */
+
+                break;
             }
 
             if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
@@ -1045,17 +1056,6 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
 
         f->length -= u->buffer.pos - start;
 
-        if (rc == NGX_AGAIN) {
-            if (u->buffer.pos == u->buffer.last) {
-                return NGX_AGAIN;
-            }
-
-            ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
-                          "upstream split a header in FastCGI records");
-
-            return NGX_HTTP_UPSTREAM_INVALID_HEADER;
-        }
-
         if (f->length == 0) {
             if (f->padding) {
                 f->state = ngx_http_fastcgi_st_padding;
@@ -1064,7 +1064,20 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
             }
         }
 
-        return NGX_OK;
+        if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
+            return NGX_OK;
+        }
+
+        if (u->buffer.pos == u->buffer.last) {
+            return NGX_AGAIN;
+        }
+
+        if (rc == NGX_AGAIN) {
+            ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+                          "upstream split a header line in FastCGI records");
+
+            return NGX_HTTP_UPSTREAM_INVALID_HEADER;
+        }
     }
 }
 
index b97515cc3ce0bffcdc4e358f5de65badd12c37e2..348c84bfc06d47a0a257ad4330ab59a6de36aa72 100644 (file)
@@ -1396,7 +1396,6 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
         || rc == NGX_HTTP_REQUEST_TIME_OUT
         || r->connection->error)
     {
-
         if (ngx_http_post_action(r) == NGX_OK) {
             return;
         }
index cb552837121c40891e3deb7e7f39cf7a3e0c7ab9..e73b3b37919db6ad8143b1d8d5af078fc12539b6 100644 (file)
@@ -283,8 +283,12 @@ ngx_http_upstream_init(ngx_http_request_t *r)
         ngx_del_timer(c->read);
     }
 
-    r->read_event_handler = ngx_http_upstream_rd_check_broken_connection;
-    r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;
+    if (!(r->http_version == NGX_HTTP_VERSION_9 && r->header_only)) {
+        /* not a post_action */
+
+        r->read_event_handler = ngx_http_upstream_rd_check_broken_connection;
+        r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;
+    }
 
     if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {