aboutsummaryrefslogtreecommitdiff
path: root/src/core/nginx.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-03-19 12:38:37 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-03-19 12:38:37 +0000
commitc15717285d2157a603bb1b130b26d7baa549be7e (patch)
tree56dc8346b22bb2660eecd3bc086d263ac6d67326 /src/core/nginx.c
parente12fbfe82a176cd386cdcecfeabf43ac8fd870a4 (diff)
downloadnginx-c15717285d2157a603bb1b130b26d7baa549be7e.tar.gz
nginx-c15717285d2157a603bb1b130b26d7baa549be7e.zip
nginx-0.1.25-RELEASE importrelease-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.
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r--src/core/nginx.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index d6ee9f652..e2a35dc67 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -141,7 +141,8 @@ main(int argc, char *const *argv)
ngx_pid = ngx_getpid();
- if (!(log = ngx_log_init())) {
+ log = ngx_log_init();
+ if (log == NULL) {
return 1;
}
@@ -155,7 +156,8 @@ main(int argc, char *const *argv)
init_cycle.log = log;
ngx_cycle = &init_cycle;
- if (!(init_cycle.pool = ngx_create_pool(1024, log))) {
+ init_cycle.pool = ngx_create_pool(1024, log);
+ if (init_cycle.pool == NULL) {
return 1;
}
@@ -255,9 +257,9 @@ main(int argc, char *const *argv)
static ngx_int_t
ngx_add_inherited_sockets(ngx_cycle_t *cycle)
{
- u_char *p, *v, *inherited;
- ngx_socket_t s;
- ngx_listening_t *ls;
+ u_char *p, *v, *inherited;
+ ngx_int_t s;
+ ngx_listening_t *ls;
inherited = (u_char *) getenv(NGINX_VAR);
@@ -287,11 +289,12 @@ ngx_add_inherited_sockets(ngx_cycle_t *cycle)
v = p + 1;
- if (!(ls = ngx_array_push(&cycle->listening))) {
+ ls = ngx_array_push(&cycle->listening);
+ if (ls == NULL) {
return NGX_ERROR;
}
- ls->fd = s;
+ ls->fd = (ngx_socket_t) s;
}
}
@@ -315,7 +318,7 @@ ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
ctx.argv = argv;
var = ngx_alloc(sizeof(NGINX_VAR)
- + cycle->listening.nelts * (NGX_INT32_LEN + 1) + 2,
+ + cycle->listening.nelts * (NGX_INT32_LEN + 1) + 2,
cycle->log);
p = ngx_cpymem(var, NGINX_VAR "=", sizeof(NGINX_VAR));
@@ -411,27 +414,29 @@ static ngx_int_t ngx_getopt(ngx_cycle_t *cycle, int argc, char *const *argv)
static ngx_int_t
ngx_save_argv(ngx_cycle_t *cycle, int argc, char *const *argv)
{
- size_t len;
- ngx_int_t i;
+#if (NGX_FREEBSD)
ngx_os_argv = (char **) argv;
-
ngx_argc = argc;
-
-#if (NGX_FREEBSD)
-
ngx_argv = (char **) argv;
#else
+ size_t len;
+ ngx_int_t i;
+
+ ngx_os_argv = (char **) argv;
+ ngx_argc = argc;
- if (!(ngx_argv = ngx_alloc((argc + 1) * sizeof(char *), cycle->log))) {
+ ngx_argv = ngx_alloc((argc + 1) * sizeof(char *), cycle->log);
+ if (ngx_argv == NULL) {
return NGX_ERROR;
}
for (i = 0; i < argc; i++) {
len = ngx_strlen(argv[i]) + 1;
- if (!(ngx_argv[i] = ngx_alloc(len, cycle->log))) {
+ ngx_argv[i] = ngx_alloc(len, cycle->log);
+ if (ngx_argv[i] == NULL) {
return NGX_ERROR;
}
@@ -451,7 +456,8 @@ ngx_core_module_create_conf(ngx_cycle_t *cycle)
{
ngx_core_conf_t *ccf;
- if (!(ccf = ngx_pcalloc(cycle->pool, sizeof(ngx_core_conf_t)))) {
+ ccf = ngx_pcalloc(cycle->pool, sizeof(ngx_core_conf_t));
+ if (ccf == NULL) {
return NULL;
}
@@ -534,7 +540,8 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
ccf->newpid.len = ccf->pid.len + sizeof(NGX_NEWPID_EXT);
- if (!(ccf->newpid.data = ngx_palloc(cycle->pool, ccf->newpid.len))) {
+ ccf->newpid.data = ngx_palloc(cycle->pool, ccf->newpid.len);
+ if (ccf->newpid.data == NULL) {
return NGX_CONF_ERROR;
}