comparison src/http/ngx_http.c @ 88:674d333f4296

nginx-0.0.1-2003-05-14-21:13:13 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 14 May 2003 17:13:13 +0000
parents b2ece31c976a
children 29bf798b583f
comparison
equal deleted inserted replaced
87:5f6d848dcbef 88:674d333f4296
40 40
41 41
42 static ngx_command_t ngx_http_commands[] = { 42 static ngx_command_t ngx_http_commands[] = {
43 43
44 {ngx_string("http"), 44 {ngx_string("http"),
45 NGX_CONF_BLOCK|NGX_CONF_NOARGS, 45 NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
46 ngx_http_block, 46 ngx_http_block,
47 0, 47 0,
48 0}, 48 0},
49 49
50 {ngx_string(""), 0, NULL, 0, 0} 50 {ngx_string(""), 0, NULL, 0, 0}
67 char *rv; 67 char *rv;
68 struct sockaddr_in *addr_in; 68 struct sockaddr_in *addr_in;
69 ngx_array_t in_ports; 69 ngx_array_t in_ports;
70 ngx_listen_t *ls; 70 ngx_listen_t *ls;
71 ngx_http_module_t *module; 71 ngx_http_module_t *module;
72 ngx_http_conf_ctx_t *ctx, *prev; 72 ngx_conf_t prev;
73 ngx_http_conf_ctx_t *ctx;
73 ngx_http_in_port_t *in_port; 74 ngx_http_in_port_t *in_port;
74 ngx_http_in_addr_t *in_addr, *inaddr; 75 ngx_http_in_addr_t *in_addr, *inaddr;
75 ngx_http_core_srv_conf_t **cscf; 76 ngx_http_core_srv_conf_t **cscf;
76 ngx_http_listen_t *lscf; 77 ngx_http_listen_t *lscf;
77 ngx_http_server_name_t *s_name, *name;; 78 ngx_http_server_name_t *s_name, *name;;
111 module->create_loc_conf(cf->pool), 112 module->create_loc_conf(cf->pool),
112 NGX_CONF_ERROR); 113 NGX_CONF_ERROR);
113 } 114 }
114 } 115 }
115 116
116 prev = cf->ctx; 117 prev = *cf;
117 cf->ctx = ctx; 118 cf->ctx = ctx;
118 cf->type = NGX_HTTP_MODULE_TYPE; 119 cf->module_type = NGX_HTTP_MODULE_TYPE;
119 120 cf->cmd_type = NGX_HTTP_MAIN_CONF;
120 rv = ngx_conf_parse(cf, NULL); 121 rv = ngx_conf_parse(cf, NULL);
121 cf->ctx = prev; 122 *cf = prev;
122 123
123 if (rv != NGX_CONF_OK) 124 if (rv != NGX_CONF_OK)
124 return rv; 125 return rv;
125 126
126 127
145 cf->pool, 10, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); 146 cf->pool, 10, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR);
146 147
147 ngx_init_array(ngx_http_index_handlers, 148 ngx_init_array(ngx_http_index_handlers,
148 cf->pool, 3, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); 149 cf->pool, 3, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR);
149 150
150 /* create lists of ports, addresses and server names */ 151 /* create lists of the ports, the addresses and the server names */
151 152
152 ngx_init_array(in_ports, cf->pool, 10, sizeof(ngx_http_in_port_t), 153 ngx_init_array(in_ports, cf->pool, 10, sizeof(ngx_http_in_port_t),
153 NGX_CONF_ERROR); 154 NGX_CONF_ERROR);
154 155
155 cscf = (ngx_http_core_srv_conf_t **) ngx_http_servers.elts; 156 cscf = (ngx_http_core_srv_conf_t **) ngx_http_servers.elts;