comparison src/os/unix/ngx_channel.c @ 334:42974b9e97b5 NGINX_0_5_37

nginx 0.5.37 *) Bugfix: if sub_filter and SSI were used together, then responses might were transferred incorrectly. *) Bugfix: large SSI inclusions might be truncated. *) 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. *) Bugfix: an alert "sendmsg() failed (9: Bad file descriptor)" on some 64-bit platforms while reconfiguration.
author Igor Sysoev <http://sysoev.ru>
date Mon, 07 Jul 2008 00:00:00 +0400
parents df17fbafec8f
children
comparison
equal deleted inserted replaced
333:30e294abe0ca 334:42974b9e97b5
31 31
32 } else { 32 } else {
33 msg.msg_control = (caddr_t) &cmsg; 33 msg.msg_control = (caddr_t) &cmsg;
34 msg.msg_controllen = sizeof(cmsg); 34 msg.msg_controllen = sizeof(cmsg);
35 35
36 cmsg.cm.cmsg_len = sizeof(cmsg); 36 cmsg.cm.cmsg_len = CMSG_LEN(sizeof(int));
37 cmsg.cm.cmsg_level = SOL_SOCKET; 37 cmsg.cm.cmsg_level = SOL_SOCKET;
38 cmsg.cm.cmsg_type = SCM_RIGHTS; 38 cmsg.cm.cmsg_type = SCM_RIGHTS;
39 *(int *) CMSG_DATA(&cmsg.cm) = ch->fd; 39 *(int *) CMSG_DATA(&cmsg.cm) = ch->fd;
40 } 40 }
41 41
136 136
137 #if (NGX_HAVE_MSGHDR_MSG_CONTROL) 137 #if (NGX_HAVE_MSGHDR_MSG_CONTROL)
138 138
139 if (ch->command == NGX_CMD_OPEN_CHANNEL) { 139 if (ch->command == NGX_CMD_OPEN_CHANNEL) {
140 140
141 if (cmsg.cm.cmsg_len < (socklen_t) sizeof(cmsg)) { 141 if (cmsg.cm.cmsg_len < (socklen_t) CMSG_LEN(sizeof(int))) {
142 ngx_log_error(NGX_LOG_ALERT, log, 0, 142 ngx_log_error(NGX_LOG_ALERT, log, 0,
143 "recvmsg() returned too small ancillary data"); 143 "recvmsg() returned too small ancillary data");
144 return NGX_ERROR; 144 return NGX_ERROR;
145 } 145 }
146 146