Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_socket.c @ 694:88a1b4797f2e NGINX_1_3_10
nginx 1.3.10
*) Change: domain names specified in configuration file are now resolved
to IPv6 addresses as well as IPv4 ones.
*) Change: now if the "include" directive with mask is used on Unix
systems, included files are sorted in alphabetical order.
*) Change: the "add_header" directive adds headers to 201 responses.
*) Feature: the "geo" directive now supports IPv6 addresses in CIDR
notation.
*) Feature: the "flush" and "gzip" parameters of the "access_log"
directive.
*) Feature: variables support in the "auth_basic" directive.
*) Bugfix: nginx could not be built with the ngx_http_perl_module in
some cases.
*) Bugfix: a segmentation fault might occur in a worker process if the
ngx_http_xslt_module was used.
*) Bugfix: nginx could not be built on MacOSX in some cases.
Thanks to Piotr Sikora.
*) Bugfix: the "limit_rate" directive with high rates might result in
truncated responses on 32-bit platforms.
Thanks to Alexey Antropov.
*) Bugfix: a segmentation fault might occur in a worker process if the
"if" directive was used.
Thanks to Piotr Sikora.
*) Bugfix: a "100 Continue" response was issued with "413 Request Entity
Too Large" responses.
*) Bugfix: the "image_filter", "image_filter_jpeg_quality" and
"image_filter_sharpen" directives might be inherited incorrectly.
Thanks to Ian Babrou.
*) Bugfix: "crypt_r() failed" errors might appear if the "auth_basic"
directive was used on Linux.
*) Bugfix: in backup servers handling.
Thanks to Thomas Chen.
*) Bugfix: proxied HEAD requests might return incorrect response if the
"gzip" directive was used.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 25 Dec 2012 00:00:00 +0400 |
parents | d0f7a625f27c |
children |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
660 | 4 * Copyright (C) Nginx, Inc. |
0 | 5 */ |
6 | |
7 | |
8 #include <ngx_config.h> | |
9 #include <ngx_core.h> | |
10 | |
11 | |
12 /* | |
236 | 13 * ioctl(FIONBIO) sets a non-blocking mode with the single syscall |
14 * while fcntl(F_SETFL, O_NONBLOCK) needs to learn the current state | |
15 * using fcntl(F_GETFL). | |
0 | 16 * |
112 | 17 * ioctl() and fcntl() are syscalls at least in FreeBSD 2.x, Linux 2.2 |
0 | 18 * and Solaris 7. |
19 * | |
2 | 20 * ioctl() in Linux 2.4 and 2.6 uses BKL, however, fcntl(F_SETFL) uses it too. |
0 | 21 */ |
22 | |
23 | |
18 | 24 #if (NGX_HAVE_FIONBIO) |
0 | 25 |
50 | 26 int |
27 ngx_nonblocking(ngx_socket_t s) | |
0 | 28 { |
286 | 29 int nb; |
0 | 30 |
31 nb = 1; | |
32 | |
33 return ioctl(s, FIONBIO, &nb); | |
34 } | |
35 | |
36 | |
50 | 37 int |
38 ngx_blocking(ngx_socket_t s) | |
0 | 39 { |
286 | 40 int nb; |
0 | 41 |
42 nb = 0; | |
43 | |
44 return ioctl(s, FIONBIO, &nb); | |
45 } | |
46 | |
47 #endif | |
48 | |
49 | |
4 | 50 #if (NGX_FREEBSD) |
0 | 51 |
50 | 52 int |
53 ngx_tcp_nopush(ngx_socket_t s) | |
0 | 54 { |
55 int tcp_nopush; | |
56 | |
57 tcp_nopush = 1; | |
58 | |
59 return setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, | |
60 (const void *) &tcp_nopush, sizeof(int)); | |
61 } | |
62 | |
63 | |
50 | 64 int |
65 ngx_tcp_push(ngx_socket_t s) | |
0 | 66 { |
67 int tcp_nopush; | |
68 | |
69 tcp_nopush = 0; | |
70 | |
71 return setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, | |
72 (const void *) &tcp_nopush, sizeof(int)); | |
73 } | |
74 | |
4 | 75 #elif (NGX_LINUX) |
0 | 76 |
112 | 77 |
50 | 78 int |
79 ngx_tcp_nopush(ngx_socket_t s) | |
0 | 80 { |
81 int cork; | |
82 | |
83 cork = 1; | |
84 | |
85 return setsockopt(s, IPPROTO_TCP, TCP_CORK, | |
86 (const void *) &cork, sizeof(int)); | |
87 } | |
88 | |
112 | 89 |
50 | 90 int |
91 ngx_tcp_push(ngx_socket_t s) | |
0 | 92 { |
93 int cork; | |
94 | |
95 cork = 0; | |
96 | |
97 return setsockopt(s, IPPROTO_TCP, TCP_CORK, | |
98 (const void *) &cork, sizeof(int)); | |
99 } | |
100 | |
101 #else | |
102 | |
50 | 103 int |
104 ngx_tcp_nopush(ngx_socket_t s) | |
0 | 105 { |
50 | 106 return 0; |
0 | 107 } |
108 | |
112 | 109 |
50 | 110 int |
111 ngx_tcp_push(ngx_socket_t s) | |
0 | 112 { |
50 | 113 return 0; |
0 | 114 } |
115 | |
116 #endif |