comparison src/http/ngx_http_core_module.c @ 92:19cc647ecd91

nginx-0.0.1-2003-05-20-19:37:55 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 20 May 2003 15:37:55 +0000
parents 637625a2acdb
children 738fe44c70d5
comparison
equal deleted inserted replaced
91:637625a2acdb 92:19cc647ecd91
265 265
266 void ngx_http_handler(ngx_http_request_t *r) 266 void ngx_http_handler(ngx_http_request_t *r)
267 { 267 {
268 int rc, i; 268 int rc, i;
269 ngx_http_handler_pt *h; 269 ngx_http_handler_pt *h;
270 ngx_http_module_t *module;
271 ngx_http_core_loc_conf_t *lcf, **lcfp; 270 ngx_http_core_loc_conf_t *lcf, **lcfp;
272 ngx_http_core_srv_conf_t *scf; 271 ngx_http_core_srv_conf_t *scf;
273 272
274 r->connection->unexpected_eof = 0; 273 r->connection->unexpected_eof = 0;
275 274
347 } 346 }
348 347
349 348
350 int ngx_http_core_translate_handler(ngx_http_request_t *r) 349 int ngx_http_core_translate_handler(ngx_http_request_t *r)
351 { 350 {
352 int i, rc, len, port_len, f_offset, l_offset; 351 int len, port_len, f_offset, l_offset;
353 char *buf, *location, *last; 352 char *buf, *location, *last;
354 ngx_err_t err; 353 ngx_err_t err;
355 ngx_table_elt_t *h; 354 ngx_table_elt_t *h;
356 ngx_http_server_name_t *s_name; 355 ngx_http_server_name_t *s_name;
357 ngx_http_core_srv_conf_t *scf; 356 ngx_http_core_srv_conf_t *scf;
621 } 620 }
622 621
623 622
624 static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy) 623 static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy)
625 { 624 {
626 int i, j; 625 int m;
627 char *rv; 626 char *rv;
628 ngx_http_module_t *module; 627 ngx_http_module_t *module;
629 ngx_conf_t pcf; 628 ngx_conf_t pcf;
630 ngx_http_conf_ctx_t *ctx, *hctx, *pctx; 629 ngx_http_conf_ctx_t *ctx, *hctx, *pctx;
631 ngx_http_core_main_conf_t *cmcf; 630 ngx_http_core_main_conf_t *cmcf;
648 647
649 ngx_test_null(ctx->loc_conf, 648 ngx_test_null(ctx->loc_conf,
650 ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module), 649 ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module),
651 NGX_CONF_ERROR); 650 NGX_CONF_ERROR);
652 651
653 for (i = 0; ngx_modules[i]; i++) { 652 for (m = 0; ngx_modules[m]; m++) {
654 if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) { 653 if (ngx_modules[m]->type != NGX_HTTP_MODULE_TYPE) {
655 continue; 654 continue;
656 } 655 }
657 656
658 module = (ngx_http_module_t *) ngx_modules[i]->ctx; 657 module = (ngx_http_module_t *) ngx_modules[m]->ctx;
659 658
660 if (module->create_srv_conf) { 659 if (module->create_srv_conf) {
661 ngx_test_null(ctx->srv_conf[module->index], 660 ngx_test_null(ctx->srv_conf[module->index],
662 module->create_srv_conf(cf->pool), 661 module->create_srv_conf(cf->pool),
663 NGX_CONF_ERROR); 662 NGX_CONF_ERROR);
993 992
994 static char *ngx_set_listen(ngx_conf_t *cf, ngx_command_t *cmd, char *conf) 993 static char *ngx_set_listen(ngx_conf_t *cf, ngx_command_t *cmd, char *conf)
995 { 994 {
996 ngx_http_core_srv_conf_t *scf = (ngx_http_core_srv_conf_t *) conf; 995 ngx_http_core_srv_conf_t *scf = (ngx_http_core_srv_conf_t *) conf;
997 996
998 uint p;
999 char *addr; 997 char *addr;
998 u_int p;
1000 ngx_str_t *args; 999 ngx_str_t *args;
1001 ngx_http_listen_t *ls; 1000 ngx_http_listen_t *ls;
1002 1001
1003 /* TODO: check duplicate 'listen' directives */ 1002 /* TODO: check duplicate 'listen' directives */
1004 1003