comparison src/os/unix/ngx_linux_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 267ea1d98683
children 008276b9e061
comparison
equal deleted inserted replaced
217:c5d1cdcb04ec 218:05592fd7a436
4 #include <ngx_event.h> 4 #include <ngx_event.h>
5 5
6 6
7 /* 7 /*
8 * On Linux up to 2.4.21 sendfile() (syscall #187) works with 32-bit 8 * On Linux up to 2.4.21 sendfile() (syscall #187) works with 32-bit
9 * offsets only and the including <sys/sendfile.h> breaks building if 9 * offsets only and the including <sys/sendfile.h> breaks the compiling if
10 * off_t is 64 bit wide. So we use own sendfile() definition where offset 10 * off_t is 64 bit wide. So we use own sendfile() definition where offset
11 * parameter is int32_t and use sendfile() with the file parts below 2G. 11 * parameter is int32_t and use sendfile() with the file parts below 2G.
12 * 12 *
13 * Linux 2.4.21 has a new sendfile64() syscall #239. 13 * Linux 2.4.21 has a new sendfile64() syscall #239.
14 */ 14 */
73 prev = cl->hunk->last; 73 prev = cl->hunk->last;
74 } 74 }
75 75
76 /* set TCP_CORK if there is a header before a file */ 76 /* set TCP_CORK if there is a header before a file */
77 77
78 if (!c->tcp_nopush 78 if (!c->tcp_nopush == 0
79 && header.nelts != 0 79 && header.nelts != 0
80 && cl 80 && cl
81 && cl->hunk->type & NGX_HUNK_FILE) 81 && cl->hunk->type & NGX_HUNK_FILE)
82 { 82 {
83 c->tcp_nopush = 1; 83 c->tcp_nopush = 1;
84 84
85 ngx_log_debug(c->log, "CORK"); 85 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "tcp_nopush");
86 86
87 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) { 87 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
88 ngx_log_error(NGX_LOG_CRIT, c->log, ngx_errno, 88 ngx_log_error(NGX_LOG_CRIT, c->log, ngx_errno,
89 ngx_tcp_nopush_n " failed"); 89 ngx_tcp_nopush_n " failed");
90 return NGX_CHAIN_ERROR; 90 return NGX_CHAIN_ERROR;