diff src/http/ngx_http_upstream.c @ 50:72eb30262aac NGINX_0_1_25

nginx 0.1.25 *) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 19 Mar 2005 00:00:00 +0300
parents a39d1b793287
children 0d75d65c642f
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -129,13 +129,14 @@ ngx_http_upstream_init(ngx_http_request_
     u->writer.pool = r->pool;
 
     if (ngx_array_init(&u->states, r->pool, u->peer.peers->number,
-                               sizeof(ngx_http_upstream_state_t)) == NGX_ERROR)
+                       sizeof(ngx_http_upstream_state_t)) != NGX_OK)
     {
         ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
         return;
     }
 
-    if (!(u->state = ngx_push_array(&u->states))) {
+    u->state = ngx_array_push(&u->states);
+    if (u->state == NULL) {
         ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
         return;
     }
@@ -317,7 +318,8 @@ ngx_http_upstream_connect(ngx_http_reque
     if (r->request_body->buf) {
         if (r->request_body->temp_file) {
 
-            if (!(u->output.free = ngx_alloc_chain_link(r->pool))) {
+            u->output.free = ngx_alloc_chain_link(r->pool);
+            if (u->output.free == NULL) {
                 ngx_http_upstream_finalize_request(r, u,
                                                 NGX_HTTP_INTERNAL_SERVER_ERROR);
                 return;
@@ -392,7 +394,8 @@ ngx_http_upstream_reinit(ngx_http_reques
 
     /* add one more state */
 
-    if (!(u->state = ngx_push_array(&u->states))) {
+    u->state = ngx_array_push(&u->states);
+    if (u->state == NULL) {
         ngx_http_upstream_finalize_request(r, u,
                                            NGX_HTTP_INTERNAL_SERVER_ERROR);
         return;
@@ -739,7 +742,8 @@ ngx_http_upstream_send_response(ngx_http
     
     p->cachable = u->cachable;
 
-    if (!(p->temp_file = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t)))) {
+    p->temp_file = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
+    if (p->temp_file == NULL) {
         ngx_http_upstream_finalize_request(r, u, 0);
         return;
     }
@@ -759,7 +763,8 @@ ngx_http_upstream_send_response(ngx_http
     p->max_temp_file_size = u->conf->max_temp_file_size;
     p->temp_file_write_size = u->conf->temp_file_write_size;
 
-    if (!(p->preread_bufs = ngx_alloc_chain_link(r->pool))) {
+    p->preread_bufs = ngx_alloc_chain_link(r->pool);
+    if (p->preread_bufs == NULL) {
         ngx_http_upstream_finalize_request(r, u, 0);
         return;
     }