comparison src/event/ngx_event.c @ 323:ba876b26b76d

nginx-0.0.3-2004-04-21-22:54:33 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 21 Apr 2004 18:54:33 +0000
parents 11ff50a35d6d
children 7c3323909107
comparison
equal deleted inserted replaced
322:ab2f8c9a2a45 323:ba876b26b76d
54 54
55 ngx_atomic_t *ngx_accept_mutex_ptr; 55 ngx_atomic_t *ngx_accept_mutex_ptr;
56 ngx_atomic_t *ngx_accept_mutex; 56 ngx_atomic_t *ngx_accept_mutex;
57 ngx_uint_t ngx_accept_mutex_held; 57 ngx_uint_t ngx_accept_mutex_held;
58 ngx_msec_t ngx_accept_mutex_delay; 58 ngx_msec_t ngx_accept_mutex_delay;
59 ngx_int_t ngx_accept_disabled;
59 60
60 61
61 62
62 static ngx_command_t ngx_events_commands[] = { 63 static ngx_command_t ngx_events_commands[] = {
63 64
462 { 463 {
463 ngx_event_conf_t *ecf = conf; 464 ngx_event_conf_t *ecf = conf;
464 465
465 ngx_str_t *value; 466 ngx_str_t *value;
466 467
467 if (ecf->connections != NGX_CONF_UNSET) { 468 if (ecf->connections != NGX_CONF_UNSET_UINT) {
468 return "is duplicate" ; 469 return "is duplicate" ;
469 } 470 }
470 471
471 value = cf->args->elts; 472 value = cf->args->elts;
472 ecf->connections = ngx_atoi(value[1].data, value[1].len); 473 ecf->connections = ngx_atoi(value[1].data, value[1].len);
473 if (ecf->connections == NGX_ERROR) { 474 if (ecf->connections == (ngx_uint_t) NGX_ERROR) {
474 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 475 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
475 "invalid number \"%s\"", value[1].data); 476 "invalid number \"%s\"", value[1].data);
476 477
477 return NGX_CONF_ERROR; 478 return NGX_CONF_ERROR;
478 } 479 }
596 ngx_event_conf_t *ecf; 597 ngx_event_conf_t *ecf;
597 598
598 ngx_test_null(ecf, ngx_palloc(cycle->pool, sizeof(ngx_event_conf_t)), 599 ngx_test_null(ecf, ngx_palloc(cycle->pool, sizeof(ngx_event_conf_t)),
599 NGX_CONF_ERROR); 600 NGX_CONF_ERROR);
600 601
601 ecf->connections = NGX_CONF_UNSET; 602 ecf->connections = NGX_CONF_UNSET_UINT;
602 ecf->use = NGX_CONF_UNSET; 603 ecf->use = NGX_CONF_UNSET;
603 ecf->multi_accept = NGX_CONF_UNSET; 604 ecf->multi_accept = NGX_CONF_UNSET;
604 ecf->accept_mutex = NGX_CONF_UNSET; 605 ecf->accept_mutex = NGX_CONF_UNSET;
605 ecf->accept_mutex_delay = NGX_CONF_UNSET_MSEC; 606 ecf->accept_mutex_delay = NGX_CONF_UNSET_MSEC;
606 ecf->name = (void *) NGX_CONF_UNSET; 607 ecf->name = (void *) NGX_CONF_UNSET;
618 { 619 {
619 ngx_event_conf_t *ecf = conf; 620 ngx_event_conf_t *ecf = conf;
620 621
621 #if (HAVE_KQUEUE) 622 #if (HAVE_KQUEUE)
622 623
623 ngx_conf_init_value(ecf->connections, DEFAULT_CONNECTIONS); 624 ngx_conf_init_unsigned_value(ecf->connections, DEFAULT_CONNECTIONS);
624 ngx_conf_init_value(ecf->use, ngx_kqueue_module.ctx_index); 625 ngx_conf_init_value(ecf->use, ngx_kqueue_module.ctx_index);
625 ngx_conf_init_ptr_value(ecf->name, ngx_kqueue_module_ctx.name->data); 626 ngx_conf_init_ptr_value(ecf->name, ngx_kqueue_module_ctx.name->data);
626 627
627 #elif (HAVE_DEVPOLL) 628 #elif (HAVE_DEVPOLL)
628 629
629 ngx_conf_init_value(ecf->connections, DEFAULT_CONNECTIONS); 630 ngx_conf_init_unsigned_value(ecf->connections, DEFAULT_CONNECTIONS);
630 ngx_conf_init_value(ecf->use, ngx_devpoll_module.ctx_index); 631 ngx_conf_init_value(ecf->use, ngx_devpoll_module.ctx_index);
631 ngx_conf_init_ptr_value(ecf->name, ngx_devpoll_module_ctx.name->data); 632 ngx_conf_init_ptr_value(ecf->name, ngx_devpoll_module_ctx.name->data);
632 633
633 #elif (HAVE_EPOLL) 634 #elif (HAVE_EPOLL)
634 635
635 ngx_conf_init_value(ecf->connections, DEFAULT_CONNECTIONS); 636 ngx_conf_init_unsigned_value(ecf->connections, DEFAULT_CONNECTIONS);
636 ngx_conf_init_value(ecf->use, ngx_epoll_module.ctx_index); 637 ngx_conf_init_value(ecf->use, ngx_epoll_module.ctx_index);
637 ngx_conf_init_ptr_value(ecf->name, ngx_epoll_module_ctx.name->data); 638 ngx_conf_init_ptr_value(ecf->name, ngx_epoll_module_ctx.name->data);
638 639
639 #elif (HAVE_SELECT) 640 #elif (HAVE_SELECT)
640 641
641 ngx_conf_init_value(ecf->connections, 642 ngx_conf_init_unsigned_value(ecf->connections,
642 FD_SETSIZE < DEFAULT_CONNECTIONS ? FD_SETSIZE : DEFAULT_CONNECTIONS); 643 FD_SETSIZE < DEFAULT_CONNECTIONS ? FD_SETSIZE : DEFAULT_CONNECTIONS);
643 644
644 ngx_conf_init_value(ecf->use, ngx_select_module.ctx_index); 645 ngx_conf_init_value(ecf->use, ngx_select_module.ctx_index);
645 ngx_conf_init_ptr_value(ecf->name, ngx_select_module_ctx.name->data); 646 ngx_conf_init_ptr_value(ecf->name, ngx_select_module_ctx.name->data);
646 647