comparison src/http/ngx_http_core_module.c @ 393:5659d773cfa8

nginx-0.0.7-2004-07-15-20:35:51 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 15 Jul 2004 16:35:51 +0000
parents b670db10cbbd
children f8f0f1834266
comparison
equal deleted inserted replaced
392:d1222d46b3f9 393:5659d773cfa8
16 void *parent, void *child); 16 void *parent, void *child);
17 static void *ngx_http_core_create_loc_conf(ngx_conf_t *cf); 17 static void *ngx_http_core_create_loc_conf(ngx_conf_t *cf);
18 static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf, 18 static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
19 void *parent, void *child); 19 void *parent, void *child);
20 20
21 static ngx_int_t ngx_http_core_init(ngx_cycle_t *cycle); 21 static ngx_int_t ngx_http_core_init_process(ngx_cycle_t *cycle);
22 static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy); 22 static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy);
23 static int ngx_cmp_locations(const void *first, const void *second); 23 static int ngx_cmp_locations(const void *first, const void *second);
24 static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd, 24 static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd,
25 void *dummy); 25 void *dummy);
26 static char *ngx_types_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 26 static char *ngx_types_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
301 ngx_module_t ngx_http_core_module = { 301 ngx_module_t ngx_http_core_module = {
302 NGX_MODULE, 302 NGX_MODULE,
303 &ngx_http_core_module_ctx, /* module context */ 303 &ngx_http_core_module_ctx, /* module context */
304 ngx_http_core_commands, /* module directives */ 304 ngx_http_core_commands, /* module directives */
305 NGX_HTTP_MODULE, /* module type */ 305 NGX_HTTP_MODULE, /* module type */
306 ngx_http_core_init, /* init module */ 306 NULL, /* init module */
307 NULL /* init child */ 307 ngx_http_core_init_process /* init process */
308 }; 308 };
309 309
310 310
311 void ngx_http_handler(ngx_http_request_t *r) 311 void ngx_http_handler(ngx_http_request_t *r)
312 { 312 {
820 } 820 }
821 821
822 #endif 822 #endif
823 823
824 824
825 static ngx_int_t ngx_http_core_init(ngx_cycle_t *cycle) 825 static ngx_int_t ngx_http_core_init_process(ngx_cycle_t *cycle)
826 { 826 {
827 ngx_uint_t i;
828 ngx_http_core_srv_conf_t **cscfp;
829 ngx_http_core_main_conf_t *cmcf;
830
831 cmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_core_module);
832
827 #if 0 833 #if 0
828 ngx_http_handler_pt *h; 834 ngx_http_core_init_module:
829 ngx_http_conf_ctx_t *ctx; 835
830 ngx_http_core_main_conf_t *cmcf; 836 ngx_http_handler_pt *h;
831
832 ctx = (ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index];
833 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
834 837
835 ngx_test_null(h, ngx_push_array( 838 ngx_test_null(h, ngx_push_array(
836 &cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers), 839 &cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers),
837 NGX_ERROR); 840 NGX_ERROR);
838 *h = ngx_http_delay_handler; 841 *h = ngx_http_delay_handler;
839 #endif 842 #endif
843
844 cscfp = cmcf->servers.elts;
845
846 for (i = 0; i < cmcf->servers.nelts; i++) {
847 if (cscfp[i]->recv == NULL) {
848 cscfp[i]->recv = ngx_io.recv;
849 cscfp[i]->send_chain = ngx_io.send_chain;
850 }
851 }
840 852
841 return NGX_OK; 853 return NGX_OK;
842 } 854 }
843 855
844 856