Mercurial > hg > nginx
comparison src/os/unix/ngx_freebsd_sendfile_chain.c @ 201:267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 30 Nov 2003 20:03:18 +0000 |
parents | 0b81c7a0b133 |
children | c9da5900c79e |
comparison
equal
deleted
inserted
replaced
200:abeaebe0a33c | 201:267ea1d98683 |
---|---|
3 #include <ngx_core.h> | 3 #include <ngx_core.h> |
4 #include <ngx_event.h> | 4 #include <ngx_event.h> |
5 | 5 |
6 | 6 |
7 /* | 7 /* |
8 * sendfile() often sends 4K pages over ethernet in 3 packets: 2x1460 and 1176 | 8 * FreeBSD's sendfile() often sends 4K pages over ethernet in 3 packets: 2x1460 |
9 * or in 6 packets: 5x1460 and 892. Besides although sendfile() allows | 9 * and 1176 or in 6 packets: 5x1460 and 892. Besides although sendfile() |
10 * to pass the header and the trailer it never sends the header or the trailer | 10 * allows to pass the header and the trailer it never sends the header or |
11 * with the part of the file in one packet. So we use TCP_NOPUSH (similar | 11 * the trailer with the part of the file in one packet. So we use TCP_NOPUSH |
12 * to Linux's TCP_CORK) to postpone the sending - it not only sends the header | 12 * (similar to Linux's TCP_CORK) to postpone the sending - it not only sends |
13 * and the first part of the file in one packet but also sends 4K pages | 13 * the header and the first part of the file in one packet but also sends |
14 * in the full packets. | 14 * 4K pages in the full packets. |
15 * | 15 * |
16 * Until FreeBSD 4.5 the turning TCP_NOPUSH off does not flush the pending | 16 * Until FreeBSD 4.5 the turning TCP_NOPUSH off does not flush a pending |
17 * data that less than MSS so the data can be sent with 5 second delay. | 17 * data that less than MSS so that data can be sent with 5 second delay. |
18 * We do not use TCP_NOPUSH on FreeBSD prior to 4.5 although it can be used | 18 * We do not use TCP_NOPUSH on FreeBSD prior to 4.5 although it can be used |
19 * for non-keepalive HTTP connections. | 19 * for non-keepalive HTTP connections. |
20 */ | 20 */ |
21 | 21 |
22 | 22 |