Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 103:6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 11 Jun 2003 15:28:34 +0000 |
parents | 7ebc8b7fb816 |
children | 00bee6e7b485 |
comparison
equal
deleted
inserted
replaced
102:7e86d028d8f0 | 103:6dfda4cf5200 |
---|---|
1 | 1 |
2 #include <ngx_config.h> | 2 #include <ngx_config.h> |
3 #include <ngx_core.h> | 3 #include <ngx_core.h> |
4 | |
5 /* ???? */ | |
6 #include <ngx_listen.h> | |
7 | |
8 #include <ngx_http.h> | 4 #include <ngx_http.h> |
9 #include <nginx.h> | 5 #include <nginx.h> |
10 | 6 |
11 | 7 |
12 /* STUB */ | 8 /* STUB */ |
44 0, | 40 0, |
45 0, | 41 0, |
46 NULL}, | 42 NULL}, |
47 | 43 |
48 {ngx_string("connection_pool_size"), | 44 {ngx_string("connection_pool_size"), |
49 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | 45 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
50 ngx_conf_set_size_slot, | 46 ngx_conf_set_size_slot, |
51 NGX_HTTP_MAIN_CONF_OFFSET, | 47 NGX_HTTP_SRV_CONF_OFFSET, |
52 offsetof(ngx_http_core_main_conf_t, connection_pool_size), | 48 offsetof(ngx_http_core_srv_conf_t, connection_pool_size), |
53 NULL}, | 49 NULL}, |
54 | 50 |
55 {ngx_string("post_accept_timeout"), | 51 {ngx_string("post_accept_timeout"), |
56 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | 52 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
57 ngx_conf_set_msec_slot, | 53 ngx_conf_set_msec_slot, |
58 NGX_HTTP_MAIN_CONF_OFFSET, | 54 NGX_HTTP_SRV_CONF_OFFSET, |
59 offsetof(ngx_http_core_main_conf_t, post_accept_timeout), | 55 offsetof(ngx_http_core_srv_conf_t, post_accept_timeout), |
60 NULL}, | 56 NULL}, |
61 | 57 |
62 {ngx_string("request_pool_size"), | 58 {ngx_string("request_pool_size"), |
63 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, | 59 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
64 ngx_conf_set_size_slot, | 60 ngx_conf_set_size_slot, |
736 | 732 |
737 ngx_test_null(cmcf, | 733 ngx_test_null(cmcf, |
738 ngx_palloc(pool, sizeof(ngx_http_core_main_conf_t)), | 734 ngx_palloc(pool, sizeof(ngx_http_core_main_conf_t)), |
739 NGX_CONF_ERROR); | 735 NGX_CONF_ERROR); |
740 | 736 |
741 cmcf->connection_pool_size = NGX_CONF_UNSET; | |
742 cmcf->post_accept_timeout = NGX_CONF_UNSET; | |
743 | |
744 ngx_init_array(cmcf->servers, pool, 5, sizeof(ngx_http_core_srv_conf_t *), | 737 ngx_init_array(cmcf->servers, pool, 5, sizeof(ngx_http_core_srv_conf_t *), |
745 NGX_CONF_ERROR); | 738 NGX_CONF_ERROR); |
746 | 739 |
747 return cmcf; | 740 return cmcf; |
748 } | 741 } |
750 | 743 |
751 static char *ngx_http_core_init_main_conf(ngx_pool_t *pool, void *conf) | 744 static char *ngx_http_core_init_main_conf(ngx_pool_t *pool, void *conf) |
752 { | 745 { |
753 ngx_http_core_main_conf_t *cmcf = conf; | 746 ngx_http_core_main_conf_t *cmcf = conf; |
754 | 747 |
755 ngx_conf_init_size_value(cmcf->connection_pool_size, 16384); | 748 /* TODO: remove it if no directives */ |
756 ngx_conf_init_msec_value(cmcf->post_accept_timeout, 30000); | |
757 | 749 |
758 return NGX_CONF_OK; | 750 return NGX_CONF_OK; |
759 } | 751 } |
760 | 752 |
761 | 753 |
771 ngx_init_array(cscf->listen, pool, 5, sizeof(ngx_http_listen_t), | 763 ngx_init_array(cscf->listen, pool, 5, sizeof(ngx_http_listen_t), |
772 NGX_CONF_ERROR); | 764 NGX_CONF_ERROR); |
773 ngx_init_array(cscf->server_names, pool, 5, sizeof(ngx_http_server_name_t), | 765 ngx_init_array(cscf->server_names, pool, 5, sizeof(ngx_http_server_name_t), |
774 NGX_CONF_ERROR); | 766 NGX_CONF_ERROR); |
775 | 767 |
768 cscf->connection_pool_size = NGX_CONF_UNSET; | |
769 cscf->post_accept_timeout = NGX_CONF_UNSET; | |
776 cscf->request_pool_size = NGX_CONF_UNSET; | 770 cscf->request_pool_size = NGX_CONF_UNSET; |
777 cscf->client_header_timeout = NGX_CONF_UNSET; | 771 cscf->client_header_timeout = NGX_CONF_UNSET; |
778 cscf->client_header_buffer_size = NGX_CONF_UNSET; | 772 cscf->client_header_buffer_size = NGX_CONF_UNSET; |
779 cscf->large_client_header = NGX_CONF_UNSET; | 773 cscf->large_client_header = NGX_CONF_UNSET; |
780 | 774 |
825 | 819 |
826 n->name.len = ngx_strlen(n->name.data); | 820 n->name.len = ngx_strlen(n->name.data); |
827 n->core_srv_conf = conf; | 821 n->core_srv_conf = conf; |
828 } | 822 } |
829 | 823 |
824 ngx_conf_merge_size_value(conf->connection_pool_size, | |
825 prev->connection_pool_size, 16384); | |
826 ngx_conf_merge_msec_value(conf->post_accept_timeout, | |
827 prev->post_accept_timeout, 30000); | |
830 ngx_conf_merge_size_value(conf->request_pool_size, | 828 ngx_conf_merge_size_value(conf->request_pool_size, |
831 prev->request_pool_size, 16384); | 829 prev->request_pool_size, 16384); |
832 ngx_conf_merge_msec_value(conf->client_header_timeout, | 830 ngx_conf_merge_msec_value(conf->client_header_timeout, |
833 prev->client_header_timeout, 60000); | 831 prev->client_header_timeout, 60000); |
834 ngx_conf_merge_size_value(conf->client_header_buffer_size, | 832 ngx_conf_merge_size_value(conf->client_header_buffer_size, |
943 u_int p; | 941 u_int p; |
944 struct hostent *h; | 942 struct hostent *h; |
945 ngx_str_t *args; | 943 ngx_str_t *args; |
946 ngx_http_listen_t *ls; | 944 ngx_http_listen_t *ls; |
947 | 945 |
948 /* TODO: check duplicate 'listen' directives, | 946 /* TODO: check duplicate 'listen' directives, |
949 add resolved name to server names ??? */ | 947 add resolved name to server names ??? */ |
950 | 948 |
951 ngx_test_null(ls, ngx_push_array(&scf->listen), NGX_CONF_ERROR); | 949 ngx_test_null(ls, ngx_push_array(&scf->listen), NGX_CONF_ERROR); |
952 | 950 |
953 /* AF_INET only */ | 951 /* AF_INET only */ |