comparison src/os/unix/ngx_process_cycle.c @ 376:d13234035cad NGINX_0_6_32

nginx 0.6.32 *) Change: the "none" parameter in the "ssl_session_cache" directive; now this is default parameter. Thanks to Rob Mueller. *) Change: now the 0x00-0x1F, '"' and '\' characters are escaped as \xXX in an access_log. Thanks to Maxim Dounin. *) Change: now nginx allows several "Host" request header line. *) Feature: the "modified" flag in the "expires" directive. *) Feature: the $uid_got and $uid_set variables may be used at any request processing stage. *) Feature: the $hostname variable. Thanks to Andrei Nigmatulin. *) Feature: DESTDIR support. Thanks to Todd A. Fisher and Andras Voroskoi. *) Bugfix: if sub_filter and SSI were used together, then responses might were transferred incorrectly. *) Bugfix: large SSI inclusions might be truncated. *) Bugfix: the "proxy_pass" directive did not work with the HTTPS protocol; the bug had appeared in 0.6.9. *) Bugfix: worker processes might not catch reconfiguration and log rotation signals. *) Bugfix: nginx could not be built on latest Fedora 9 Linux. Thanks to Roxis. *) Bugfix: a segmentation fault might occur in worker process on Linux, if keepalive was enabled.
author Igor Sysoev <http://sysoev.ru>
date Mon, 07 Jul 2008 00:00:00 +0400
parents babd3d9efb62
children
comparison
equal deleted inserted replaced
375:52f3c9c7eff0 376:d13234035cad
1052 1052
1053 c = ev->data; 1053 c = ev->data;
1054 1054
1055 ngx_log_debug0(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel handler"); 1055 ngx_log_debug0(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel handler");
1056 1056
1057 n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log); 1057 for ( ;; ) {
1058 1058
1059 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n); 1059 n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log);
1060 1060
1061 if (n == NGX_ERROR) { 1061 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n);
1062 1062
1063 if (ngx_event_flags & NGX_USE_EPOLL_EVENT) { 1063 if (n == NGX_ERROR) {
1064 ngx_del_conn(c, 0); 1064
1065 } 1065 if (ngx_event_flags & NGX_USE_EPOLL_EVENT) {
1066 1066 ngx_del_conn(c, 0);
1067 ngx_close_connection(c); 1067 }
1068 return; 1068
1069 } 1069 ngx_close_connection(c);
1070
1071 if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
1072 if (ngx_add_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) {
1073 return; 1070 return;
1074 } 1071 }
1075 } 1072
1076 1073 if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
1077 if (n == NGX_AGAIN) { 1074 if (ngx_add_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) {
1078 return; 1075 return;
1079 } 1076 }
1080 1077 }
1081 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, 1078
1082 "channel command: %d", ch.command); 1079 if (n == NGX_AGAIN) {
1083 1080 return;
1084 switch (ch.command) { 1081 }
1085 1082
1086 case NGX_CMD_QUIT: 1083 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0,
1087 ngx_quit = 1; 1084 "channel command: %d", ch.command);
1088 break; 1085
1089 1086 switch (ch.command) {
1090 case NGX_CMD_TERMINATE: 1087
1091 ngx_terminate = 1; 1088 case NGX_CMD_QUIT:
1092 break; 1089 ngx_quit = 1;
1093 1090 break;
1094 case NGX_CMD_REOPEN: 1091
1095 ngx_reopen = 1; 1092 case NGX_CMD_TERMINATE:
1096 break; 1093 ngx_terminate = 1;
1097 1094 break;
1098 case NGX_CMD_OPEN_CHANNEL: 1095
1099 1096 case NGX_CMD_REOPEN:
1100 ngx_log_debug3(NGX_LOG_DEBUG_CORE, ev->log, 0, 1097 ngx_reopen = 1;
1101 "get channel s:%i pid:%P fd:%d", ch.slot, ch.pid, ch.fd); 1098 break;
1102 1099
1103 ngx_processes[ch.slot].pid = ch.pid; 1100 case NGX_CMD_OPEN_CHANNEL:
1104 ngx_processes[ch.slot].channel[0] = ch.fd; 1101
1105 break; 1102 ngx_log_debug3(NGX_LOG_DEBUG_CORE, ev->log, 0,
1106 1103 "get channel s:%i pid:%P fd:%d",
1107 case NGX_CMD_CLOSE_CHANNEL: 1104 ch.slot, ch.pid, ch.fd);
1108 1105
1109 ngx_log_debug4(NGX_LOG_DEBUG_CORE, ev->log, 0, 1106 ngx_processes[ch.slot].pid = ch.pid;
1110 "close channel s:%i pid:%P our:%P fd:%d", 1107 ngx_processes[ch.slot].channel[0] = ch.fd;
1111 ch.slot, ch.pid, ngx_processes[ch.slot].pid, 1108 break;
1112 ngx_processes[ch.slot].channel[0]); 1109
1113 1110 case NGX_CMD_CLOSE_CHANNEL:
1114 if (close(ngx_processes[ch.slot].channel[0]) == -1) { 1111
1115 ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno, 1112 ngx_log_debug4(NGX_LOG_DEBUG_CORE, ev->log, 0,
1116 "close() channel failed"); 1113 "close channel s:%i pid:%P our:%P fd:%d",
1117 } 1114 ch.slot, ch.pid, ngx_processes[ch.slot].pid,
1118 1115 ngx_processes[ch.slot].channel[0]);
1119 ngx_processes[ch.slot].channel[0] = -1; 1116
1120 break; 1117 if (close(ngx_processes[ch.slot].channel[0]) == -1) {
1118 ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
1119 "close() channel failed");
1120 }
1121
1122 ngx_processes[ch.slot].channel[0] = -1;
1123 break;
1124 }
1121 } 1125 }
1122 } 1126 }
1123 1127
1124 1128
1125 #if (NGX_THREADS) 1129 #if (NGX_THREADS)