comparison src/os/unix/ngx_freebsd_sendfile_chain.c @ 3080:af427e13cfd7

small optimization
author Igor Sysoev <igor@sysoev.ru>
date Fri, 04 Sep 2009 09:50:58 +0000
parents 113cd532b328
children 10bfdd8d5eb9
comparison
equal deleted inserted replaced
3079:566eeb81e807 3080:af427e13cfd7
293 return NGX_CHAIN_ERROR; 293 return NGX_CHAIN_ERROR;
294 } 294 }
295 295
296 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err, 296 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err,
297 "sendfile() sent only %O bytes", sent); 297 "sendfile() sent only %O bytes", sent);
298 }
299 298
300 /* 299 /*
301 * sendfile() in FreeBSD 3.x-4.x may return value >= 0 300 * sendfile() in FreeBSD 3.x-4.x may return value >= 0
302 * on success, although only 0 is documented 301 * on success, although only 0 is documented
303 */ 302 */
304 303
305 if (rc >= 0 && sent == 0) { 304 } else if (rc >= 0 && sent == 0) {
306 305
307 /* 306 /*
308 * if rc is OK and sent equal to zero, then someone 307 * if rc is OK and sent equal to zero, then someone
309 * has truncated the file, so the offset became beyond 308 * has truncated the file, so the offset became beyond
310 * the end of the file 309 * the end of the file