nginx-0.1.25-RELEASE import

    *) 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.
diff --git a/src/event/modules/ngx_devpoll_module.c b/src/event/modules/ngx_devpoll_module.c
index 2d94ba4..57b6b12 100644
--- a/src/event/modules/ngx_devpoll_module.c
+++ b/src/event/modules/ngx_devpoll_module.c
@@ -134,19 +134,21 @@
             ngx_free(change_list);
         }
 
-        ngx_test_null(change_list,
-                      ngx_alloc(sizeof(struct pollfd) * dpcf->changes,
-                                cycle->log),
-                      NGX_ERROR);
+        change_list = ngx_alloc(sizeof(struct pollfd) * dpcf->changes,
+                                cycle->log);
+        if (change_list == NULL) {
+            return NGX_ERROR;
+        }
 
         if (change_index) {
             ngx_free(change_index);
         }
 
-        ngx_test_null(change_index,
-                      ngx_alloc(sizeof(ngx_event_t *) * dpcf->changes,
-                                cycle->log),
-                      NGX_ERROR);
+        change_index = ngx_alloc(sizeof(ngx_event_t *) * dpcf->changes,
+                                 cycle->log);
+        if (change_index == NULL) {
+            return NGX_ERROR;
+        }
     }
 
     max_changes = dpcf->changes;
@@ -156,10 +158,11 @@
             ngx_free(event_list);
         }
 
-        ngx_test_null(event_list,
-                      ngx_alloc(sizeof(struct pollfd) * dpcf->events,
-                                cycle->log),
-                      NGX_ERROR);
+        event_list = ngx_alloc(sizeof(struct pollfd) * dpcf->events,
+                               cycle->log);
+        if (event_list == NULL) {
+            return NGX_ERROR;
+        }
     }
 
     nevents = dpcf->events;
@@ -318,11 +321,13 @@
 {
     int                 events, revents;
     ngx_int_t           i;
-    ngx_uint_t          j, lock, accept_lock, expire;
+    ngx_uint_t          lock, accept_lock, expire;
     size_t              n;
     ngx_msec_t          timer;
     ngx_err_t           err;
+#if 0
     ngx_cycle_t       **old_cycle;
+#endif
     ngx_event_t        *rev, *wev;
     ngx_connection_t   *c;
     ngx_epoch_msec_t    delta;
@@ -580,8 +585,10 @@
 {
     ngx_devpoll_conf_t  *dpcf;
 
-    ngx_test_null(dpcf, ngx_palloc(cycle->pool, sizeof(ngx_devpoll_conf_t)),
-                  NGX_CONF_ERROR);
+    dpcf = ngx_palloc(cycle->pool, sizeof(ngx_devpoll_conf_t));
+    if (dpcf == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     dpcf->changes = NGX_CONF_UNSET;
     dpcf->events = NGX_CONF_UNSET;
diff --git a/src/event/modules/ngx_epoll_module.c b/src/event/modules/ngx_epoll_module.c
index f2c973f..14b7750 100644
--- a/src/event/modules/ngx_epoll_module.c
+++ b/src/event/modules/ngx_epoll_module.c
@@ -133,7 +133,6 @@
 static ngx_int_t
 ngx_epoll_init(ngx_cycle_t *cycle)
 {
-    size_t             n;
     ngx_event_conf_t  *ecf;
     ngx_epoll_conf_t  *epcf;
 
@@ -380,7 +379,6 @@
 ngx_epoll_process_events(ngx_cycle_t *cycle)
 {
     int                events;
-    size_t             n;
     uint32_t           revents;
     ngx_int_t          instance, i;
     ngx_uint_t         lock, accept_lock, expire;
@@ -663,8 +661,10 @@
 {
     ngx_epoll_conf_t  *epcf;
 
-    ngx_test_null(epcf, ngx_palloc(cycle->pool, sizeof(ngx_epoll_conf_t)),
-                  NGX_CONF_ERROR);
+    epcf = ngx_palloc(cycle->pool, sizeof(ngx_epoll_conf_t));
+    if (epcf == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     epcf->events = NGX_CONF_UNSET;
 
diff --git a/src/event/modules/ngx_iocp_module.c b/src/event/modules/ngx_iocp_module.c
index 4a3cd9f..0a04a20 100644
--- a/src/event/modules/ngx_iocp_module.c
+++ b/src/event/modules/ngx_iocp_module.c
@@ -90,7 +90,8 @@
 static HANDLE  iocp;
 
 
-static ngx_int_t ngx_iocp_init(ngx_cycle_t *cycle)
+static ngx_int_t
+ngx_iocp_init(ngx_cycle_t *cycle)
 {
     ngx_iocp_conf_t  *cf;
 
@@ -117,7 +118,8 @@
 }
 
 
-static void ngx_iocp_done(ngx_cycle_t *cycle)
+static void
+ngx_iocp_done(ngx_cycle_t *cycle)
 {
     if (CloseHandle(iocp) == -1) {
         ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
@@ -128,7 +130,8 @@
 }
 
 
-static ngx_int_t ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key)
+static ngx_int_t
+ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key)
 {
     ngx_connection_t  *c;
 
@@ -150,7 +153,8 @@
 }
 
 
-static ngx_int_t ngx_iocp_del_connection(ngx_connection_t *c, u_int flags)
+static ngx_int_t
+ngx_iocp_del_connection(ngx_connection_t *c, u_int flags)
 {
 #if 0
     if (flags & NGX_CLOSE_EVENT) {
@@ -167,7 +171,8 @@
 }
 
 
-static ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle)
+static
+ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle)
 {
     int                rc;
     u_int              key;
@@ -301,12 +306,15 @@
 }
 
 
-static void *ngx_iocp_create_conf(ngx_cycle_t *cycle)
+static void *
+ngx_iocp_create_conf(ngx_cycle_t *cycle)
 {
     ngx_iocp_conf_t  *cf;
 
-    ngx_test_null(cf, ngx_palloc(cycle->pool, sizeof(ngx_iocp_conf_t)),
-                  NGX_CONF_ERROR);
+    cf = ngx_palloc(cycle->pool, sizeof(ngx_iocp_conf_t));
+    if (cf == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     cf->threads = NGX_CONF_UNSET;
     cf->post_acceptex = NGX_CONF_UNSET;
@@ -316,7 +324,8 @@
 }
 
 
-static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf)
+static char *
+ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf)
 {
     ngx_iocp_conf_t *cf = conf;
 
diff --git a/src/event/modules/ngx_kqueue_module.c b/src/event/modules/ngx_kqueue_module.c
index b4555d9..14bbfaf 100644
--- a/src/event/modules/ngx_kqueue_module.c
+++ b/src/event/modules/ngx_kqueue_module.c
@@ -123,11 +123,13 @@
 
 #if (NGX_THREADS)
 
-        if (!(list_mutex = ngx_mutex_init(cycle->log, 0))) {
+        list_mutex = ngx_mutex_init(cycle->log, 0);
+        if (list_mutex == NULL) {
             return NGX_ERROR;
         }
 
-        if (!(kevent_mutex = ngx_mutex_init(cycle->log, 0))) {
+        kevent_mutex = ngx_mutex_init(cycle->log, 0);
+        if (kevent_mutex == NULL) {
             return NGX_ERROR;
         }
 
@@ -797,8 +799,10 @@
 {
     ngx_kqueue_conf_t  *kcf;
 
-    ngx_test_null(kcf, ngx_palloc(cycle->pool, sizeof(ngx_kqueue_conf_t)),
-                  NGX_CONF_ERROR);
+    kcf = ngx_palloc(cycle->pool, sizeof(ngx_kqueue_conf_t));
+    if (kcf == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     kcf->changes = NGX_CONF_UNSET;
     kcf->events = NGX_CONF_UNSET;
diff --git a/src/event/modules/ngx_poll_module.c b/src/event/modules/ngx_poll_module.c
index 6ea3af4..c25a561 100644
--- a/src/event/modules/ngx_poll_module.c
+++ b/src/event/modules/ngx_poll_module.c
@@ -73,10 +73,11 @@
         || cycle->old_cycle == NULL
         || cycle->old_cycle->connection_n < cycle->connection_n)
     {
-        ngx_test_null(list,
-                      ngx_alloc(sizeof(struct pollfd) * cycle->connection_n,
-                                cycle->log),
-                      NGX_ERROR);
+        list = ngx_alloc(sizeof(struct pollfd) * cycle->connection_n,
+                         cycle->log);
+        if (list == NULL) {
+            return NGX_ERROR;
+        }
 
         if (event_list) {
             ngx_memcpy(list, event_list, sizeof(ngx_event_t *) * nevents);
@@ -90,10 +91,11 @@
             ngx_free(ready_index);
         }
 
-        ngx_test_null(ready_index,
-                      ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
-                                cycle->log),
-                      NGX_ERROR);
+        ready_index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
+                                cycle->log);
+        if (ready_index == NULL) {
+            return NGX_ERROR;
+        }
 #endif
     }
 
diff --git a/src/event/modules/ngx_rtsig_module.c b/src/event/modules/ngx_rtsig_module.c
index 07b8bd9..6c94977 100644
--- a/src/event/modules/ngx_rtsig_module.c
+++ b/src/event/modules/ngx_rtsig_module.c
@@ -274,9 +274,8 @@
 ngx_rtsig_process_events(ngx_cycle_t *cycle)
 {
     int                 signo;
-    ngx_int_t           instance, i;
+    ngx_int_t           instance;
     ngx_uint_t          expire;
-    size_t              n;
     ngx_msec_t          timer;
     ngx_err_t           err;
     siginfo_t           si;
@@ -777,8 +776,10 @@
 {
     ngx_rtsig_conf_t  *rtscf;
 
-    ngx_test_null(rtscf, ngx_palloc(cycle->pool, sizeof(ngx_rtsig_conf_t)),
-                  NGX_CONF_ERROR);
+    rtscf = ngx_palloc(cycle->pool, sizeof(ngx_rtsig_conf_t));
+    if (rtscf == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     rtscf->signo = NGX_CONF_UNSET;
     rtscf->overflow_events = NGX_CONF_UNSET;
diff --git a/src/event/modules/ngx_select_module.c b/src/event/modules/ngx_select_module.c
index 623e13c..6edc284 100644
--- a/src/event/modules/ngx_select_module.c
+++ b/src/event/modules/ngx_select_module.c
@@ -72,7 +72,8 @@
 };
 
 
-static ngx_int_t ngx_select_init(ngx_cycle_t *cycle)
+static ngx_int_t
+ngx_select_init(ngx_cycle_t *cycle)
 {
     ngx_event_t  **index;
 
@@ -86,10 +87,11 @@
         || cycle->old_cycle == NULL
         || cycle->old_cycle->connection_n < cycle->connection_n)
     {
-        ngx_test_null(index,
-                      ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
-                                cycle->log),
-                      NGX_ERROR);
+        index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
+                          cycle->log);
+        if (index == NULL) {
+            return NGX_ERROR;
+        }
 
         if (event_index) {
             ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents);
@@ -101,10 +103,12 @@
         if (ready_index) {
             ngx_free(ready_index);
         }
-        ngx_test_null(ready_index,
-                      ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
-                      cycle->log),
-                      NGX_ERROR);
+
+        ready_index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
+                                cycle->log);
+        if (ready_index == NULL) {
+            return NGX_ERROR;
+        }
 #endif
     }
 
@@ -124,7 +128,8 @@
 }
 
 
-static void ngx_select_done(ngx_cycle_t *cycle)
+static void
+ngx_select_done(ngx_cycle_t *cycle)
 {
     ngx_free(event_index);
 #if 0
@@ -135,7 +140,8 @@
 }
 
 
-static ngx_int_t ngx_select_add_event(ngx_event_t *ev, int event, u_int flags)
+static ngx_int_t
+ngx_select_add_event(ngx_event_t *ev, int event, u_int flags)
 {
     ngx_connection_t  *c;
 
@@ -196,7 +202,8 @@
 }
 
 
-static ngx_int_t ngx_select_del_event(ngx_event_t *ev, int event, u_int flags)
+static ngx_int_t
+ngx_select_del_event(ngx_event_t *ev, int event, u_int flags)
 {
     ngx_connection_t  *c;
 
@@ -248,7 +255,8 @@
 }
 
 
-static ngx_int_t ngx_select_process_events(ngx_cycle_t *cycle)
+static ngx_int_t
+ngx_select_process_events(ngx_cycle_t *cycle)
 {
     int                       ready, nready;
     ngx_uint_t                i, found, lock, expire;
@@ -592,7 +600,8 @@
 }
 
 
-static char *ngx_select_init_conf(ngx_cycle_t *cycle, void *conf)
+static char *
+ngx_select_init_conf(ngx_cycle_t *cycle, void *conf)
 {
     ngx_event_conf_t  *ecf;