comparison src/http/ngx_http.c @ 114:ac69ab96328d

nginx-0.0.1-2003-07-07-10:11:50 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 07 Jul 2003 06:11:50 +0000
parents d7f606e25b99
children 571bcbff82c5
comparison
equal deleted inserted replaced
113:d7f606e25b99 114:ac69ab96328d
67 ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)), 67 ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)),
68 NGX_CONF_ERROR); 68 NGX_CONF_ERROR);
69 69
70 *(ngx_http_conf_ctx_t **) conf = ctx; 70 *(ngx_http_conf_ctx_t **) conf = ctx;
71 71
72
73 /* count the number of the http modules and set up their indices */ 72 /* count the number of the http modules and set up their indices */
74 73
75 ngx_http_max_module = 0; 74 ngx_http_max_module = 0;
76 for (m = 0; ngx_modules[m]; m++) { 75 for (m = 0; ngx_modules[m]; m++) {
77 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 76 if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
271 if (lscf[l].flags & NGX_HTTP_DEFAULT_SERVER) { 270 if (lscf[l].flags & NGX_HTTP_DEFAULT_SERVER) {
272 if (in_addr[a].flags 271 if (in_addr[a].flags
273 & NGX_HTTP_DEFAULT_SERVER) { 272 & NGX_HTTP_DEFAULT_SERVER) {
274 273
275 ngx_log_error(NGX_LOG_ERR, cf->log, 0, 274 ngx_log_error(NGX_LOG_ERR, cf->log, 0,
276 "duplicate default server in %s:%d", 275 "duplicate default server in %s:%d",
277 lscf[l].file_name.data, 276 lscf[l].file_name.data,
278 lscf[l].line); 277 lscf[l].line);
279 278
280 return NGX_CONF_ERROR; 279 return NGX_CONF_ERROR;
281 } 280 }
282 281
283 in_addr[a].flags |= NGX_HTTP_DEFAULT_SERVER; 282 in_addr[a].flags |= NGX_HTTP_DEFAULT_SERVER;
469 cscf = in_addr[a].core_srv_conf; 468 cscf = in_addr[a].core_srv_conf;
470 ls->pool_size = cscf->connection_pool_size; 469 ls->pool_size = cscf->connection_pool_size;
471 ls->post_accept_timeout = cscf->post_accept_timeout; 470 ls->post_accept_timeout = cscf->post_accept_timeout;
472 471
473 #if (WIN32) 472 #if (WIN32)
474 iocpcf = ngx_event_get_conf(ngx_iocp_module); 473 iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module);
475 if (iocpcf->acceptex_read) { 474 if (iocpcf->acceptex_read) {
476 ls->post_accept_buffer_size = cscf->client_header_buffer_size; 475 ls->post_accept_buffer_size = cscf->client_header_buffer_size;
477 } 476 }
478 #endif 477 #endif
479 478
487 /* if this port has not the "*:port" binding then create 486 /* if this port has not the "*:port" binding then create
488 the separate ngx_http_in_port_t for the all bindings */ 487 the separate ngx_http_in_port_t for the all bindings */
489 488
490 ngx_test_null(inport, 489 ngx_test_null(inport,
491 ngx_palloc(cf->pool, 490 ngx_palloc(cf->pool,
492 sizeof(ngx_http_in_port_t)), 491 sizeof(ngx_http_in_port_t)),
493 NGX_CONF_ERROR); 492 NGX_CONF_ERROR);
494 493
495 inport->port = in_port[p].port; 494 inport->port = in_port[p].port;
496 inport->port_name = in_port[p].port_name; 495 inport->port_name = in_port[p].port_name;
497 496
527 } 526 }
528 527
529 /* DEBUG STUFF */ 528 /* DEBUG STUFF */
530 in_port = in_ports.elts; 529 in_port = in_ports.elts;
531 for (p = 0; p < in_ports.nelts; p++) { 530 for (p = 0; p < in_ports.nelts; p++) {
532 ngx_log_debug(cf->log, "port: %d" _ in_port[p].port); 531 ngx_log_debug(cf->log, "port: %d %08x" _ in_port[p].port _ &in_port[p]);
533 in_addr = in_port[p].addrs.elts; 532 in_addr = in_port[p].addrs.elts;
534 for (a = 0; a < in_port[p].addrs.nelts; a++) { 533 for (a = 0; a < in_port[p].addrs.nelts; a++) {
535 char ip[20]; 534 char ip[20];
536 ngx_inet_ntop(AF_INET, (char *) &in_addr[a].addr, ip, 20); 535 ngx_inet_ntop(AF_INET, (char *) &in_addr[a].addr, ip, 20);
537 ngx_log_debug(cf->log, "%s %08x" _ ip _ in_addr[a].core_srv_conf); 536 ngx_log_debug(cf->log, "%s %08x" _ ip _ in_addr[a].core_srv_conf);