comparison src/http/ngx_http_core_module.c @ 439:4fe393d82f44

nginx-0.0.12-2004-09-26-23:01:48 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 26 Sep 2004 19:01:48 +0000
parents e56ab5ac8c65
children f390d1775430
comparison
equal deleted inserted replaced
438:e56ab5ac8c65 439:4fe393d82f44
871 #if 0 871 #if 0
872 ngx_http_core_init_module: 872 ngx_http_core_init_module:
873 873
874 ngx_http_handler_pt *h; 874 ngx_http_handler_pt *h;
875 875
876 if (!(h = ngx_array_push(&cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers))) 876 ngx_test_null(h, ngx_push_array(
877 return NGX_ERROR; 877 &cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers),
878 } 878 NGX_ERROR);
879 *h = ngx_http_delay_handler; 879 *h = ngx_http_delay_handler;
880 #endif 880 #endif
881 881
882 cscfp = cmcf->servers.elts; 882 cscfp = cmcf->servers.elts;
883 883
902 ngx_conf_t pvcf; 902 ngx_conf_t pvcf;
903 ngx_http_conf_ctx_t *ctx, *http_ctx; 903 ngx_http_conf_ctx_t *ctx, *http_ctx;
904 ngx_http_core_main_conf_t *cmcf; 904 ngx_http_core_main_conf_t *cmcf;
905 ngx_http_core_srv_conf_t *cscf, **cscfp; 905 ngx_http_core_srv_conf_t *cscf, **cscfp;
906 906
907 if (!(ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)))) { 907 ngx_test_null(ctx,
908 return NGX_CONF_ERROR; 908 ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)),
909 } 909 NGX_CONF_ERROR);
910 910
911 http_ctx = cf->ctx; 911 http_ctx = cf->ctx;
912 ctx->main_conf = http_ctx->main_conf; 912 ctx->main_conf = http_ctx->main_conf;
913 913
914 /* the server{}'s srv_conf */ 914 /* the server{}'s srv_conf */
915 915
916 ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); 916 ngx_test_null(ctx->srv_conf,
917 if (ctx->srv_conf == NULL) { 917 ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module),
918 return NGX_CONF_ERROR; 918 NGX_CONF_ERROR);
919 }
920 919
921 /* the server{}'s loc_conf */ 920 /* the server{}'s loc_conf */
922 921
923 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); 922 ngx_test_null(ctx->loc_conf,
924 if (ctx->loc_conf == NULL) { 923 ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module),
925 return NGX_CONF_ERROR; 924 NGX_CONF_ERROR);
926 }
927 925
928 for (m = 0; ngx_modules[m]; m++) { 926 for (m = 0; ngx_modules[m]; m++) {
929 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 927 if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
930 continue; 928 continue;
931 } 929 }
1325 cmcf->max_server_name_len = n->name.len; 1323 cmcf->max_server_name_len = n->name.len;
1326 } 1324 }
1327 } 1325 }
1328 1326
1329 ngx_conf_merge_size_value(conf->connection_pool_size, 1327 ngx_conf_merge_size_value(conf->connection_pool_size,
1330 prev->connection_pool_size, 256); 1328 prev->connection_pool_size, 2048);
1331 ngx_conf_merge_msec_value(conf->post_accept_timeout, 1329 ngx_conf_merge_msec_value(conf->post_accept_timeout,
1332 prev->post_accept_timeout, 60000); 1330 prev->post_accept_timeout, 30000);
1333 ngx_conf_merge_size_value(conf->request_pool_size, 1331 ngx_conf_merge_size_value(conf->request_pool_size,
1334 prev->request_pool_size, (size_t) ngx_pagesize); 1332 prev->request_pool_size, 16384);
1335 ngx_conf_merge_msec_value(conf->client_header_timeout, 1333 ngx_conf_merge_msec_value(conf->client_header_timeout,
1336 prev->client_header_timeout, 60000); 1334 prev->client_header_timeout, 60000);
1337 ngx_conf_merge_size_value(conf->client_header_buffer_size, 1335 ngx_conf_merge_size_value(conf->client_header_buffer_size,
1338 prev->client_header_buffer_size, 1024); 1336 prev->client_header_buffer_size, 1024);
1339 ngx_conf_merge_bufs_value(conf->large_client_header_buffers, 1337 ngx_conf_merge_bufs_value(conf->large_client_header_buffers,
1462 prev->default_type, "text/plain"); 1460 prev->default_type, "text/plain");
1463 1461
1464 ngx_conf_merge_size_value(conf->client_max_body_size, 1462 ngx_conf_merge_size_value(conf->client_max_body_size,
1465 prev->client_max_body_size, 10 * 1024 * 1024); 1463 prev->client_max_body_size, 10 * 1024 * 1024);
1466 ngx_conf_merge_size_value(conf->client_body_buffer_size, 1464 ngx_conf_merge_size_value(conf->client_body_buffer_size,
1467 prev->client_body_buffer_size, 1465 prev->client_body_buffer_size, 8192);
1468 (size_t) 4 * ngx_pagesize);
1469 ngx_conf_merge_msec_value(conf->client_body_timeout, 1466 ngx_conf_merge_msec_value(conf->client_body_timeout,
1470 prev->client_body_timeout, 60000); 1467 prev->client_body_timeout, 60000);
1471 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); 1468 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
1472 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0); 1469 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
1473 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); 1470 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000);