comparison src/event/ngx_event.c @ 130:82d695e3d662 NGINX_0_3_12

nginx 0.3.12 *) Security: if nginx was built with the ngx_http_realip_module and the "satisfy_any on" directive was used, then access and authorization directives did not work. The ngx_http_realip_module was not built and is not built by default. *) Change: the "$time_gmt" variable name was changed to "$time_local". *) Change: the "proxy_header_buffer_size" and "fastcgi_header_buffer_size" directives was renamed to the "proxy_buffer_size" and "fastcgi_buffer_size" directives. *) Feature: the ngx_http_memcached_module. *) Feature: the "proxy_buffering" directive. *) Bugfix: the changes in accept mutex handling when the "rtsig" method was used; bug appeared in 0.3.0. *) Bugfix: if the client sent the "Transfer-Encoding: chunked" header line, then nginx returns the 411 error. *) Bugfix: if the "auth_basic" directive was inherited from the http level, then the realm in the "WWW-Authenticate" header line was without the "Basic realm" text. *) Bugfix: if the "combined" format was explicitly specified in the "access_log" directive, then the empty lines was written to the log; bug appeared in 0.3.8. *) Bugfix: nginx did not run on the sparc platform under any OS except Solaris. *) Bugfix: now it is not necessary to place space between the quoted string and closing bracket in the "if" directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 26 Nov 2005 00:00:00 +0300
parents df17fbafec8f
children bb61aa162c6b
comparison
equal deleted inserted replaced
129:a27c77ef3ad8 130:82d695e3d662
46 ngx_atomic_t connection_counter = 1; 46 ngx_atomic_t connection_counter = 1;
47 ngx_atomic_t *ngx_connection_counter = &connection_counter; 47 ngx_atomic_t *ngx_connection_counter = &connection_counter;
48 48
49 49
50 ngx_atomic_t *ngx_accept_mutex_ptr; 50 ngx_atomic_t *ngx_accept_mutex_ptr;
51 ngx_atomic_t *ngx_accept_mutex_last_owner;
52 ngx_atomic_t *ngx_accept_mutex; 51 ngx_atomic_t *ngx_accept_mutex;
53 ngx_uint_t ngx_accept_mutex_held; 52 ngx_uint_t ngx_accept_mutex_held;
54 ngx_msec_t ngx_accept_mutex_delay; 53 ngx_msec_t ngx_accept_mutex_delay;
55 ngx_int_t ngx_accept_disabled; 54 ngx_int_t ngx_accept_disabled;
56 ngx_file_t ngx_accept_mutex_lock_file; 55 ngx_file_t ngx_accept_mutex_lock_file;
253 if (ngx_posted_accept_events) { 252 if (ngx_posted_accept_events) {
254 ngx_event_process_posted(cycle, &ngx_posted_accept_events); 253 ngx_event_process_posted(cycle, &ngx_posted_accept_events);
255 } 254 }
256 255
257 if (ngx_accept_mutex_held) { 256 if (ngx_accept_mutex_held) {
258 *ngx_accept_mutex = 0; 257 (void) ngx_atomic_cmp_set(ngx_accept_mutex, ngx_pid, 0);
259 } 258 }
260 259
261 if (delta) { 260 if (delta) {
262 ngx_event_expire_timers(); 261 ngx_event_expire_timers();
263 } 262 }
469 468
470 469
471 /* TODO: adjust cache line size, 128 is P4 cache line size */ 470 /* TODO: adjust cache line size, 128 is P4 cache line size */
472 471
473 size = 128 /* ngx_accept_mutex */ 472 size = 128 /* ngx_accept_mutex */
474 + 128 /* ngx_accept_mutex_last_owner */
475 + 128; /* ngx_connection_counter */ 473 + 128; /* ngx_connection_counter */
476 474
477 #if (NGX_STAT_STUB) 475 #if (NGX_STAT_STUB)
478 476
479 size += 128 /* ngx_stat_accepted */ 477 size += 128 /* ngx_stat_accepted */
489 if (shared == NULL) { 487 if (shared == NULL) {
490 return NGX_ERROR; 488 return NGX_ERROR;
491 } 489 }
492 490
493 ngx_accept_mutex_ptr = (ngx_atomic_t *) shared; 491 ngx_accept_mutex_ptr = (ngx_atomic_t *) shared;
494 ngx_accept_mutex_last_owner = (ngx_atomic_t *) (shared + 1 * 128); 492 ngx_connection_counter = (ngx_atomic_t *) (shared + 1 * 128);
495 ngx_connection_counter = (ngx_atomic_t *) (shared + 2 * 128);
496 493
497 #if (NGX_STAT_STUB) 494 #if (NGX_STAT_STUB)
498 495
499 ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * 128); 496 ngx_stat_accepted = (ngx_atomic_t *) (shared + 2 * 128);
500 ngx_stat_handled = (ngx_atomic_t *) (shared + 4 * 128); 497 ngx_stat_handled = (ngx_atomic_t *) (shared + 3 * 128);
501 ngx_stat_requests = (ngx_atomic_t *) (shared + 5 * 128); 498 ngx_stat_requests = (ngx_atomic_t *) (shared + 4 * 128);
502 ngx_stat_active = (ngx_atomic_t *) (shared + 6 * 128); 499 ngx_stat_active = (ngx_atomic_t *) (shared + 5 * 128);
503 ngx_stat_reading = (ngx_atomic_t *) (shared + 7 * 128); 500 ngx_stat_reading = (ngx_atomic_t *) (shared + 6 * 128);
504 ngx_stat_writing = (ngx_atomic_t *) (shared + 8 * 128); 501 ngx_stat_writing = (ngx_atomic_t *) (shared + 7 * 128);
505 502
506 #endif 503 #endif
507 504
508 *ngx_connection_counter = 1; 505 *ngx_connection_counter = 1;
509 506
917 914
918 if (ecf->connections != NGX_CONF_UNSET_UINT) { 915 if (ecf->connections != NGX_CONF_UNSET_UINT) {
919 return "is duplicate" ; 916 return "is duplicate" ;
920 } 917 }
921 918
919 if (ngx_strcmp(cmd->name.data, "connections") == 0) {
920 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
921 "the \"connections\" directive is deprecated, "
922 "use the \"worker_connections\" directive instead");
923 }
924
922 value = cf->args->elts; 925 value = cf->args->elts;
923 ecf->connections = ngx_atoi(value[1].data, value[1].len); 926 ecf->connections = ngx_atoi(value[1].data, value[1].len);
924 if (ecf->connections == (ngx_uint_t) NGX_ERROR) { 927 if (ecf->connections == (ngx_uint_t) NGX_ERROR) {
925 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 928 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
926 "invalid number \"%V\"", &value[1]); 929 "invalid number \"%V\"", &value[1]);