summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-09-14 19:39:54 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-09-14 19:39:54 +0000
commitdc3b2a78753bdc4c97a0007c872a4f8afd049df4 (patch)
tree101c409864cf6ec6e6f285ef772e61f0924dd32c /src/http/ngx_http_core_module.c
parente2ff3ea920ba6bc3690a333abdaa2e40656f933a (diff)
downloadnginx-dc3b2a78753bdc4c97a0007c872a4f8afd049df4.tar.gz
nginx-dc3b2a78753bdc4c97a0007c872a4f8afd049df4.tar.bz2
nginx-0.0.10-2004-09-14-23:39:54 import
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index f00ae658c..be2e7fc78 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1178,14 +1178,18 @@ static char *ngx_set_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
ngx_http_type_t *type;
if (lcf->types == NULL) {
- ngx_test_null(lcf->types,
- ngx_palloc(cf->pool, NGX_HTTP_TYPES_HASH_PRIME
- * sizeof(ngx_array_t)),
- NGX_CONF_ERROR);
+ lcf->types = ngx_palloc(cf->pool, NGX_HTTP_TYPES_HASH_PRIME
+ * sizeof(ngx_array_t));
+ if (lcf->types == NULL) {
+ return NGX_CONF_ERROR;
+ }
for (i = 0; i < NGX_HTTP_TYPES_HASH_PRIME; i++) {
- ngx_init_array(lcf->types[i], cf->pool, 5, sizeof(ngx_http_type_t),
- NGX_CONF_ERROR);
+ if (ngx_array_init(&lcf->types[i], cf->pool, 5,
+ sizeof(ngx_http_type_t)) == NGX_ERROR)
+ {
+ return NGX_CONF_ERROR;
+ }
}
}
@@ -1194,7 +1198,10 @@ static char *ngx_set_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
for (i = 1; i < cf->args->nelts; i++) {
ngx_http_types_hash_key(key, args[i]);
- ngx_test_null(type, ngx_push_array(&lcf->types[key]), NGX_CONF_ERROR);
+ if (!(type = ngx_array_push(&lcf->types[key]))) {
+ return NGX_CONF_ERROR;
+ }
+
type->exten = args[i];
type->type = args[0];
}