comparison src/os/unix/ngx_process_cycle.c @ 342:4276c2f1f434 NGINX_0_6_15

nginx 0.6.15 *) Feature: cygwin compatibility. Thanks to Vladimir Kutakov. *) Feature: the "merge_slashes" directive. *) Feature: the "gzip_vary" directive. *) Feature: the "server_tokens" directive. *) Bugfix: nginx did not unescape URI in the "include" SSI command. *) Bugfix: the segmentation fault was occurred on start or while reconfiguration if variable was used in the "charset" or "source_charset" directives. *) Bugfix: nginx returned the 400 response on requests like "GET http://www.domain.com HTTP/1.0". Thanks to James Oakley. *) Bugfix: if request with request body was redirected using the "error_page" directive, then nginx tried to read the request body again; bug appeared in 0.6.7. *) Bugfix: a segmentation fault occurred in worker process if no server_name was explicitly defined for server processing request; bug appeared in 0.6.7.
author Igor Sysoev <http://sysoev.ru>
date Mon, 22 Oct 2007 00:00:00 +0400
parents 10cc350ed8a1
children b743d290eb3b
comparison
equal deleted inserted replaced
341:183b4761fe5b 342:4276c2f1f434
407 { 407 {
408 ngx_int_t i; 408 ngx_int_t i;
409 ngx_err_t err; 409 ngx_err_t err;
410 ngx_channel_t ch; 410 ngx_channel_t ch;
411 411
412 #if (NGX_BROKEN_SCM_RIGHTS)
413
414 ch.command = 0;
415
416 #else
417
412 switch (signo) { 418 switch (signo) {
413 419
414 case ngx_signal_value(NGX_SHUTDOWN_SIGNAL): 420 case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
415 ch.command = NGX_CMD_QUIT; 421 ch.command = NGX_CMD_QUIT;
416 break; 422 break;
424 break; 430 break;
425 431
426 default: 432 default:
427 ch.command = 0; 433 ch.command = 0;
428 } 434 }
435
436 #endif
429 437
430 ch.fd = -1; 438 ch.fd = -1;
431 439
432 440
433 for (i = 0; i < ngx_last_process; i++) { 441 for (i = 0; i < ngx_last_process; i++) {
1033 1041
1034 static void 1042 static void
1035 ngx_channel_handler(ngx_event_t *ev) 1043 ngx_channel_handler(ngx_event_t *ev)
1036 { 1044 {
1037 ngx_int_t n; 1045 ngx_int_t n;
1038 ngx_socket_t fd;
1039 ngx_channel_t ch; 1046 ngx_channel_t ch;
1040 ngx_connection_t *c; 1047 ngx_connection_t *c;
1041 1048
1042 if (ev->timedout) { 1049 if (ev->timedout) {
1043 ev->timedout = 0; 1050 ev->timedout = 0;
1051 n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log); 1058 n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log);
1052 1059
1053 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n); 1060 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n);
1054 1061
1055 if (n == NGX_ERROR) { 1062 if (n == NGX_ERROR) {
1056 1063 ngx_close_connection(c);
1057 ngx_free_connection(c);
1058
1059 fd = c->fd;
1060 c->fd = (ngx_socket_t) -1;
1061
1062 if (close(fd) == -1) {
1063 ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
1064 "close() channel failed");
1065 }
1066
1067 return; 1064 return;
1068 } 1065 }
1069 1066
1070 if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) { 1067 if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
1071 if (ngx_add_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) { 1068 if (ngx_add_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) {