comparison src/http/ngx_http_core_module.c @ 95:b48066122884

nginx-0.0.1-2003-05-23-15:53:01 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 23 May 2003 11:53:01 +0000
parents 8220378432a8
children a23d010f356d
comparison
equal deleted inserted replaced
94:8220378432a8 95:b48066122884
47 ngx_server_block, 47 ngx_server_block,
48 0, 48 0,
49 0, 49 0,
50 NULL,}, 50 NULL,},
51 51
52 {ngx_string("connection_pool_size"),
53 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
54 ngx_conf_set_size_slot,
55 NGX_HTTP_MAIN_CONF_OFFSET,
56 offsetof(ngx_http_core_main_conf_t, connection_pool_size),
57 NULL},
58
52 {ngx_string("post_accept_timeout"), 59 {ngx_string("post_accept_timeout"),
53 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, 60 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
54 ngx_conf_set_msec_slot, 61 ngx_conf_set_msec_slot,
55 NGX_HTTP_MAIN_CONF_OFFSET, 62 NGX_HTTP_MAIN_CONF_OFFSET,
56 offsetof(ngx_http_core_main_conf_t, post_accept_timeout), 63 offsetof(ngx_http_core_main_conf_t, post_accept_timeout),
57 NULL}, 64 NULL},
58 65
59 {ngx_string("connection_pool_size"), 66 {ngx_string("request_pool_size"),
60 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, 67 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
61 ngx_conf_set_size_slot, 68 ngx_conf_set_size_slot,
62 NGX_HTTP_MAIN_CONF_OFFSET, 69 NGX_HTTP_SRV_CONF_OFFSET,
63 offsetof(ngx_http_core_main_conf_t, connection_pool_size), 70 offsetof(ngx_http_core_srv_conf_t, request_pool_size),
64 NULL}, 71 NULL},
65 72
66 {ngx_string("request_pool_size"), 73 {ngx_string("client_header_timeout"),
67 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, 74 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
75 ngx_conf_set_msec_slot,
76 NGX_HTTP_SRV_CONF_OFFSET,
77 offsetof(ngx_http_core_srv_conf_t, client_header_timeout),
78 NULL},
79
80 {ngx_string("client_header_buffer_size"),
81 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
68 ngx_conf_set_size_slot, 82 ngx_conf_set_size_slot,
69 NGX_HTTP_MAIN_CONF_OFFSET, 83 NGX_HTTP_SRV_CONF_OFFSET,
70 offsetof(ngx_http_core_main_conf_t, request_pool_size), 84 offsetof(ngx_http_core_srv_conf_t, client_header_buffer_size),
71 NULL},
72
73 {ngx_string("client_header_timeout"),
74 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
75 ngx_conf_set_msec_slot,
76 NGX_HTTP_MAIN_CONF_OFFSET,
77 offsetof(ngx_http_core_main_conf_t, client_header_timeout),
78 NULL},
79
80 {ngx_string("client_header_buffer_size"),
81 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
82 ngx_conf_set_size_slot,
83 NGX_HTTP_MAIN_CONF_OFFSET,
84 offsetof(ngx_http_core_main_conf_t, client_header_buffer_size),
85 NULL}, 85 NULL},
86 86
87 {ngx_string("large_client_header"), 87 {ngx_string("large_client_header"),
88 NGX_HTTP_MAIN_CONF|NGX_CONF_FLAG, 88 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
89 ngx_conf_set_flag_slot, 89 ngx_conf_set_flag_slot,
90 NGX_HTTP_MAIN_CONF_OFFSET, 90 NGX_HTTP_SRV_CONF_OFFSET,
91 offsetof(ngx_http_core_main_conf_t, large_client_header), 91 offsetof(ngx_http_core_srv_conf_t, large_client_header),
92 NULL}, 92 NULL},
93 93
94 {ngx_string("location"), 94 {ngx_string("location"),
95 NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1, 95 NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1,
96 ngx_location_block, 96 ngx_location_block,
812 812
813 ngx_test_null(cmcf, 813 ngx_test_null(cmcf,
814 ngx_palloc(pool, sizeof(ngx_http_core_main_conf_t)), 814 ngx_palloc(pool, sizeof(ngx_http_core_main_conf_t)),
815 NGX_CONF_ERROR); 815 NGX_CONF_ERROR);
816 816
817 cmcf->connection_pool_size = NGX_CONF_UNSET;
817 cmcf->post_accept_timeout = NGX_CONF_UNSET; 818 cmcf->post_accept_timeout = NGX_CONF_UNSET;
818 cmcf->connection_pool_size = NGX_CONF_UNSET;
819 cmcf->request_pool_size = NGX_CONF_UNSET;
820 cmcf->client_header_timeout = NGX_CONF_UNSET;
821 cmcf->client_header_buffer_size = NGX_CONF_UNSET;
822 cmcf->large_client_header = NGX_CONF_UNSET;
823 819
824 ngx_init_array(cmcf->servers, pool, 5, sizeof(ngx_http_core_srv_conf_t *), 820 ngx_init_array(cmcf->servers, pool, 5, sizeof(ngx_http_core_srv_conf_t *),
825 NGX_CONF_ERROR); 821 NGX_CONF_ERROR);
826 822
827 return cmcf; 823 return cmcf;
830 826
831 static char *ngx_http_core_init_main_conf(ngx_pool_t *pool, void *conf) 827 static char *ngx_http_core_init_main_conf(ngx_pool_t *pool, void *conf)
832 { 828 {
833 ngx_http_core_main_conf_t *cmcf = (ngx_http_core_main_conf_t *) conf; 829 ngx_http_core_main_conf_t *cmcf = (ngx_http_core_main_conf_t *) conf;
834 830
831 ngx_conf_init_size_value(cmcf->connection_pool_size, 16384);
835 ngx_conf_init_msec_value(cmcf->post_accept_timeout, 30000); 832 ngx_conf_init_msec_value(cmcf->post_accept_timeout, 30000);
836 ngx_conf_init_size_value(cmcf->connection_pool_size, 16384);
837 ngx_conf_init_size_value(cmcf->request_pool_size, 16384);
838 ngx_conf_init_msec_value(cmcf->client_header_timeout, 60000);
839 ngx_conf_init_size_value(cmcf->client_header_buffer_size, 1024);
840 ngx_conf_init_value(cmcf->large_client_header, 1);
841 833
842 return NGX_CONF_OK; 834 return NGX_CONF_OK;
843 } 835 }
844 836
845 837
854 ngx_init_array(cscf->locations, pool, 5, sizeof(void *), NGX_CONF_ERROR); 846 ngx_init_array(cscf->locations, pool, 5, sizeof(void *), NGX_CONF_ERROR);
855 ngx_init_array(cscf->listen, pool, 5, sizeof(ngx_http_listen_t), 847 ngx_init_array(cscf->listen, pool, 5, sizeof(ngx_http_listen_t),
856 NGX_CONF_ERROR); 848 NGX_CONF_ERROR);
857 ngx_init_array(cscf->server_names, pool, 5, sizeof(ngx_http_server_name_t), 849 ngx_init_array(cscf->server_names, pool, 5, sizeof(ngx_http_server_name_t),
858 NGX_CONF_ERROR); 850 NGX_CONF_ERROR);
851
852 cscf->request_pool_size = NGX_CONF_UNSET;
853 cscf->client_header_timeout = NGX_CONF_UNSET;
854 cscf->client_header_buffer_size = NGX_CONF_UNSET;
855 cscf->large_client_header = NGX_CONF_UNSET;
859 856
860 return cscf; 857 return cscf;
861 } 858 }
862 859
863 860
893 } 890 }
894 n->name.len = ngx_strlen(n->name.data); 891 n->name.len = ngx_strlen(n->name.data);
895 n->core_srv_conf = conf; 892 n->core_srv_conf = conf;
896 } 893 }
897 894
895 ngx_conf_merge_size_value(conf->request_pool_size,
896 prev->request_pool_size, 16384);
897 ngx_conf_merge_msec_value(conf->client_header_timeout,
898 prev->client_header_timeout, 60000);
899 ngx_conf_merge_size_value(conf->client_header_buffer_size,
900 prev->client_header_buffer_size, 1024);
901 ngx_conf_merge_value(conf->large_client_header,
902 prev->large_client_header, 1);
903
898 return NGX_CONF_OK; 904 return NGX_CONF_OK;
899 } 905 }
900 906
901 907
902 static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool) 908 static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool)
982 } 988 }
983 } 989 }
984 } 990 }
985 991
986 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); 992 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
987
988 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 10000); 993 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 10000);
989
990 ngx_conf_merge_size_value(conf->discarded_buffer_size, 994 ngx_conf_merge_size_value(conf->discarded_buffer_size,
991 prev->discarded_buffer_size, 1500); 995 prev->discarded_buffer_size, 1500);
992 ngx_conf_merge_msec_value(conf->keepalive_timeout, prev->keepalive_timeout, 996 ngx_conf_merge_msec_value(conf->keepalive_timeout,
993 70000); 997 prev->keepalive_timeout, 70000);
994 ngx_conf_merge_msec_value(conf->lingering_time, prev->lingering_time, 998 ngx_conf_merge_msec_value(conf->lingering_time,
995 30000); 999 prev->lingering_time, 30000);
996 ngx_conf_merge_msec_value(conf->lingering_timeout, prev->lingering_timeout, 1000 ngx_conf_merge_msec_value(conf->lingering_timeout,
997 5000); 1001 prev->lingering_timeout, 5000);
998 1002
999 return NGX_CONF_OK; 1003 return NGX_CONF_OK;
1000 } 1004 }
1001 1005
1002 1006