Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 438:e56ab5ac8c65
nginx-0.0.12-2004-09-24-20:12:19 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 24 Sep 2004 16:12:19 +0000 |
parents | 470270fa84d2 |
children | 4fe393d82f44 |
comparison
equal
deleted
inserted
replaced
437:470270fa84d2 | 438:e56ab5ac8c65 |
---|---|
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 ngx_test_null(h, ngx_push_array( | 876 if (!(h = ngx_array_push(&cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers))) |
877 &cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers), | 877 return NGX_ERROR; |
878 NGX_ERROR); | 878 } |
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 ngx_test_null(ctx, | 907 if (!(ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)))) { |
908 ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)), | 908 return NGX_CONF_ERROR; |
909 NGX_CONF_ERROR); | 909 } |
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 ngx_test_null(ctx->srv_conf, | 916 ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); |
917 ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module), | 917 if (ctx->srv_conf == NULL) { |
918 NGX_CONF_ERROR); | 918 return NGX_CONF_ERROR; |
919 } | |
919 | 920 |
920 /* the server{}'s loc_conf */ | 921 /* the server{}'s loc_conf */ |
921 | 922 |
922 ngx_test_null(ctx->loc_conf, | 923 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); |
923 ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module), | 924 if (ctx->loc_conf == NULL) { |
924 NGX_CONF_ERROR); | 925 return NGX_CONF_ERROR; |
926 } | |
925 | 927 |
926 for (m = 0; ngx_modules[m]; m++) { | 928 for (m = 0; ngx_modules[m]; m++) { |
927 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { | 929 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { |
928 continue; | 930 continue; |
929 } | 931 } |
1323 cmcf->max_server_name_len = n->name.len; | 1325 cmcf->max_server_name_len = n->name.len; |
1324 } | 1326 } |
1325 } | 1327 } |
1326 | 1328 |
1327 ngx_conf_merge_size_value(conf->connection_pool_size, | 1329 ngx_conf_merge_size_value(conf->connection_pool_size, |
1328 prev->connection_pool_size, 2048); | 1330 prev->connection_pool_size, 256); |
1329 ngx_conf_merge_msec_value(conf->post_accept_timeout, | 1331 ngx_conf_merge_msec_value(conf->post_accept_timeout, |
1330 prev->post_accept_timeout, 30000); | 1332 prev->post_accept_timeout, 60000); |
1331 ngx_conf_merge_size_value(conf->request_pool_size, | 1333 ngx_conf_merge_size_value(conf->request_pool_size, |
1332 prev->request_pool_size, 16384); | 1334 prev->request_pool_size, (size_t) ngx_pagesize); |
1333 ngx_conf_merge_msec_value(conf->client_header_timeout, | 1335 ngx_conf_merge_msec_value(conf->client_header_timeout, |
1334 prev->client_header_timeout, 60000); | 1336 prev->client_header_timeout, 60000); |
1335 ngx_conf_merge_size_value(conf->client_header_buffer_size, | 1337 ngx_conf_merge_size_value(conf->client_header_buffer_size, |
1336 prev->client_header_buffer_size, 1024); | 1338 prev->client_header_buffer_size, 1024); |
1337 ngx_conf_merge_bufs_value(conf->large_client_header_buffers, | 1339 ngx_conf_merge_bufs_value(conf->large_client_header_buffers, |
1460 prev->default_type, "text/plain"); | 1462 prev->default_type, "text/plain"); |
1461 | 1463 |
1462 ngx_conf_merge_size_value(conf->client_max_body_size, | 1464 ngx_conf_merge_size_value(conf->client_max_body_size, |
1463 prev->client_max_body_size, 10 * 1024 * 1024); | 1465 prev->client_max_body_size, 10 * 1024 * 1024); |
1464 ngx_conf_merge_size_value(conf->client_body_buffer_size, | 1466 ngx_conf_merge_size_value(conf->client_body_buffer_size, |
1465 prev->client_body_buffer_size, 8192); | 1467 prev->client_body_buffer_size, |
1468 (size_t) 4 * ngx_pagesize); | |
1466 ngx_conf_merge_msec_value(conf->client_body_timeout, | 1469 ngx_conf_merge_msec_value(conf->client_body_timeout, |
1467 prev->client_body_timeout, 60000); | 1470 prev->client_body_timeout, 60000); |
1468 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); | 1471 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); |
1469 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0); | 1472 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0); |
1470 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); | 1473 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); |