Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 2912:c7d57b539248
return NULL instead of NGX_CONF_ERROR on a create conf failure
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 02 Jun 2009 16:09:44 +0000 |
parents | 4f5753877376 |
children | b941147f2b2e |
comparison
equal
deleted
inserted
replaced
2911:32b444fa2ca4 | 2912:c7d57b539248 |
---|---|
2701 { | 2701 { |
2702 ngx_http_core_main_conf_t *cmcf; | 2702 ngx_http_core_main_conf_t *cmcf; |
2703 | 2703 |
2704 cmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_main_conf_t)); | 2704 cmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_main_conf_t)); |
2705 if (cmcf == NULL) { | 2705 if (cmcf == NULL) { |
2706 return NGX_CONF_ERROR; | 2706 return NULL; |
2707 } | 2707 } |
2708 | 2708 |
2709 if (ngx_array_init(&cmcf->servers, cf->pool, 4, | 2709 if (ngx_array_init(&cmcf->servers, cf->pool, 4, |
2710 sizeof(ngx_http_core_srv_conf_t *)) | 2710 sizeof(ngx_http_core_srv_conf_t *)) |
2711 != NGX_OK) | 2711 != NGX_OK) |
2712 { | 2712 { |
2713 return NGX_CONF_ERROR; | 2713 return NULL; |
2714 } | 2714 } |
2715 | 2715 |
2716 cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT; | 2716 cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT; |
2717 cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT; | 2717 cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT; |
2718 | 2718 |
2760 { | 2760 { |
2761 ngx_http_core_srv_conf_t *cscf; | 2761 ngx_http_core_srv_conf_t *cscf; |
2762 | 2762 |
2763 cscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_srv_conf_t)); | 2763 cscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_srv_conf_t)); |
2764 if (cscf == NULL) { | 2764 if (cscf == NULL) { |
2765 return NGX_CONF_ERROR; | 2765 return NULL; |
2766 } | 2766 } |
2767 | 2767 |
2768 /* | 2768 /* |
2769 * set by ngx_pcalloc(): | 2769 * set by ngx_pcalloc(): |
2770 * | 2770 * |
2773 | 2773 |
2774 if (ngx_array_init(&cscf->listen, cf->temp_pool, 4, | 2774 if (ngx_array_init(&cscf->listen, cf->temp_pool, 4, |
2775 sizeof(ngx_http_listen_t)) | 2775 sizeof(ngx_http_listen_t)) |
2776 != NGX_OK) | 2776 != NGX_OK) |
2777 { | 2777 { |
2778 return NGX_CONF_ERROR; | 2778 return NULL; |
2779 } | 2779 } |
2780 | 2780 |
2781 if (ngx_array_init(&cscf->server_names, cf->temp_pool, 4, | 2781 if (ngx_array_init(&cscf->server_names, cf->temp_pool, 4, |
2782 sizeof(ngx_http_server_name_t)) | 2782 sizeof(ngx_http_server_name_t)) |
2783 != NGX_OK) | 2783 != NGX_OK) |
2784 { | 2784 { |
2785 return NGX_CONF_ERROR; | 2785 return NULL; |
2786 } | 2786 } |
2787 | 2787 |
2788 cscf->connection_pool_size = NGX_CONF_UNSET_SIZE; | 2788 cscf->connection_pool_size = NGX_CONF_UNSET_SIZE; |
2789 cscf->request_pool_size = NGX_CONF_UNSET_SIZE; | 2789 cscf->request_pool_size = NGX_CONF_UNSET_SIZE; |
2790 cscf->client_header_timeout = NGX_CONF_UNSET_MSEC; | 2790 cscf->client_header_timeout = NGX_CONF_UNSET_MSEC; |
2891 { | 2891 { |
2892 ngx_http_core_loc_conf_t *lcf; | 2892 ngx_http_core_loc_conf_t *lcf; |
2893 | 2893 |
2894 lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_loc_conf_t)); | 2894 lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_loc_conf_t)); |
2895 if (lcf == NULL) { | 2895 if (lcf == NULL) { |
2896 return NGX_CONF_ERROR; | 2896 return NULL; |
2897 } | 2897 } |
2898 | 2898 |
2899 /* | 2899 /* |
2900 * set by ngx_pcalloc(): | 2900 * set by ngx_pcalloc(): |
2901 * | 2901 * |