Mercurial > hg > nginx
comparison src/os/unix/ngx_freebsd_sendfile_chain.c @ 218:05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 05 Jan 2004 20:55:48 +0000 |
parents | f1d0e5f09c1e |
children | b6793bc5034b |
comparison
equal
deleted
inserted
replaced
217:c5d1cdcb04ec | 218:05592fd7a436 |
---|---|
149 | 149 |
150 tail = cl; | 150 tail = cl; |
151 | 151 |
152 if (file) { | 152 if (file) { |
153 | 153 |
154 if (ngx_freebsd_use_tcp_nopush && !c->tcp_nopush) { | 154 if (ngx_freebsd_use_tcp_nopush && c->tcp_nopush == 0) { |
155 c->tcp_nopush = 1; | 155 c->tcp_nopush = 1; |
156 | 156 |
157 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "tcp_nopush"); | 157 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "tcp_nopush"); |
158 | 158 |
159 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) { | 159 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) { |
189 eintr = 1; | 189 eintr = 1; |
190 | 190 |
191 } else if (err == NGX_EAGAIN) { | 191 } else if (err == NGX_EAGAIN) { |
192 eagain = 1; | 192 eagain = 1; |
193 | 193 |
194 } else if (err == NGX_EPIPE) { | 194 } else if (err == NGX_EPIPE || err == NGX_ENOTCONN) { |
195 level = NGX_LOG_INFO; | 195 level = NGX_LOG_INFO; |
196 } | 196 } |
197 | 197 |
198 if (err == NGX_EAGAIN || err == NGX_EINTR) { | 198 if (err == NGX_EAGAIN || err == NGX_EINTR) { |
199 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err, | 199 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err, |
200 "sendfile() sent only " OFF_T_FMT " bytes", | 200 "sendfile() sent only " OFF_T_FMT " bytes", |
201 sent); | 201 sent); |
202 | 202 |
203 } else { | 203 } else { |
204 wev->error = 1; | 204 wev->error = 1; |
205 #if 0 | |
205 ngx_log_error(level, c->log, err, | 206 ngx_log_error(level, c->log, err, |
206 "sendfile() failed"); | 207 "sendfile() failed"); |
208 #else | |
209 ngx_log_error(level, c->log, err, | |
210 "sendfile(#%d) failed", c->fd); | |
211 #endif | |
207 return NGX_CHAIN_ERROR; | 212 return NGX_CHAIN_ERROR; |
208 } | 213 } |
209 } | 214 } |
210 | 215 |
211 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0, | 216 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0, |