Mercurial > hg > nginx-vendor-0-7
annotate src/os/unix/ngx_darwin_init.c @ 506:b9fdcaf2062b NGINX_0_7_65
nginx 0.7.65
*) Security: now nginx/Windows ignores trailing spaces in URI.
Thanks to Dan Crowley, Core Security Technologies.
*) Security: now nginx/Windows ignores short files names.
Thanks to Dan Crowley, Core Security Technologies.
*) Change: now the "009" status code is written to an access log for
proxied HTTP/0.9 responses.
*) Change: now the default buffer size of the
"large_client_header_buffers" directive is 8K.
Thanks to Andrew Cholakian.
*) Change: now default SSL ciphers are "HIGH:!ADH:!MD5".
*) Change: now SSLv2 protocol is disabled by default.
*) Change: now $host variable value is always low case.
*) Feature: the conf/fastcgi.conf for simple FastCGI configurations.
*) Feature: now URI part is not required a "proxy_pass" directive if
variables are used.
*) Feature: the $ssl_session_id variable.
*) Bugfix: if a proxied or FastCGI request was internally redirected to
another proxied or FastCGI location, then $upstream_response_time
variable may have abnormally large value; the bug had appeared in
0.7.63.
*) Bugfix: if the "expires modified" set date in the past, then a
negative number was set in the "Cache-Control" response header
line.
Thanks to Alex Kapranoff.
*) Bugfix: nginx closed a connection if a cached response had an empty
body.
Thanks to Piotr Sikora.
*) Bugfix: nginx cached a 304 response if there was the "If-None-Match"
header line in a proxied request.
Thanks to Tim Dettrick and David Kostal.
*) Bugfix: nginx did not treat a comma as separator in the
"Cache-Control" backend response header line.
*) Bugfix: cached HTTP/0.9 responses were handled incorrectly.
*) Bugfix: nginx sent gzipped responses to clients those do not support
gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared
in 0.8.16.
*) Bugfix: nginx always added "Content-Encoding: gzip" response header
line in 304 responses sent by ngx_http_gzip_static_module.
*) Bugfix: the "!-x" operator did not work.
Thanks to Maxim Dounin.
*) Bugfix: a segmentation fault might occur in a worker process, if
limit_rate was used in HTTPS server.
Thanks to Maxim Dounin.
*) Bugfix: a segmentation fault might occur in a worker process while
$limit_rate logging.
Thanks to Maxim Dounin.
*) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms;
*) Bugfix: nginx/Windows tried to delete a temporary file twice if the
file should replace an already existent file.
*) Bugfix: nginx/Windows tried to rename a temporary file twice if the
file should replace an already existent file.
*) Bugfix: nginx/Windows might not create temporary file, a cache file,
or "proxy/fastcgi_store"d file if a worker had no enough access
rights for top level directories.
*) Bugfix: in UTF-8 encoding support by "try_files" directive in
nginx/Windows.
*) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
Thanks to Maxim Dounin.
*) Bugfix: the ngx_http_autoindex_module did not show the trailing
slash in links to a directory; the bug had appeared in 0.7.15.
*) Bugfix: nginx did not close a log file set by the --error-log-path
configuration option; the bug had appeared in 0.7.53.
*) Bugfix: "addition_types" directive was incorrectly named
"addtion_types".
*) Bugfix: invalid request line in $request variable was written in
access_log only if error_log was set to "info" or "debug" level.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 01 Feb 2010 00:00:00 +0000 |
parents | ff86d646f9df |
children |
rev | line source |
---|---|
390 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
11 char ngx_darwin_kern_ostype[16]; | |
12 char ngx_darwin_kern_osrelease[128]; | |
13 int ngx_darwin_hw_ncpu; | |
14 int ngx_darwin_kern_ipc_somaxconn; | |
15 u_long ngx_darwin_net_inet_tcp_sendspace; | |
16 | |
17 | |
18 static ngx_os_io_t ngx_darwin_io = { | |
19 ngx_unix_recv, | |
20 ngx_readv_chain, | |
21 ngx_udp_unix_recv, | |
22 ngx_unix_send, | |
23 #if (NGX_HAVE_SENDFILE) | |
24 ngx_darwin_sendfile_chain, | |
25 NGX_IO_SENDFILE | |
26 #else | |
27 ngx_writev_chain, | |
28 0 | |
29 #endif | |
30 }; | |
31 | |
32 | |
33 typedef struct { | |
34 char *name; | |
35 void *value; | |
36 size_t size; | |
37 ngx_uint_t exists; | |
38 } sysctl_t; | |
39 | |
40 | |
41 sysctl_t sysctls[] = { | |
42 { "hw.ncpu", | |
43 &ngx_darwin_hw_ncpu, | |
44 sizeof(ngx_darwin_hw_ncpu), 0 }, | |
45 | |
46 { "net.inet.tcp.sendspace", | |
47 &ngx_darwin_net_inet_tcp_sendspace, | |
48 sizeof(ngx_darwin_net_inet_tcp_sendspace), 0 }, | |
49 | |
50 { "kern.ipc.somaxconn", | |
51 &ngx_darwin_kern_ipc_somaxconn, | |
52 sizeof(ngx_darwin_kern_ipc_somaxconn), 0 }, | |
53 | |
54 { NULL, NULL, 0, 0 } | |
55 }; | |
56 | |
57 | |
58 ngx_int_t | |
59 ngx_os_specific_init(ngx_log_t *log) | |
60 { | |
61 int somaxconn; | |
62 size_t size; | |
63 ngx_err_t err; | |
64 ngx_uint_t i; | |
65 | |
66 size = sizeof(ngx_darwin_kern_ostype); | |
418 | 67 if (sysctlbyname("kern.ostype", ngx_darwin_kern_ostype, &size, NULL, 0) |
68 == -1) | |
69 { | |
70 err = ngx_errno; | |
71 | |
72 if (err != NGX_ENOENT) { | |
390 | 73 |
418 | 74 ngx_log_error(NGX_LOG_ALERT, log, err, |
75 "sysctlbyname(kern.ostype) failed"); | |
76 | |
77 if (err != NGX_ENOMEM) { | |
78 return NGX_ERROR; | |
79 } | |
80 | |
81 ngx_darwin_kern_ostype[size - 1] = '\0'; | |
390 | 82 } |
83 } | |
84 | |
85 size = sizeof(ngx_darwin_kern_osrelease); | |
418 | 86 if (sysctlbyname("kern.osrelease", ngx_darwin_kern_osrelease, &size, |
87 NULL, 0) | |
88 == -1) | |
89 { | |
90 err = ngx_errno; | |
91 | |
92 if (err != NGX_ENOENT) { | |
390 | 93 |
418 | 94 ngx_log_error(NGX_LOG_ALERT, log, err, |
95 "sysctlbyname(kern.osrelease) failed"); | |
390 | 96 |
418 | 97 if (err != NGX_ENOMEM) { |
98 return NGX_ERROR; | |
99 } | |
100 | |
101 ngx_darwin_kern_osrelease[size - 1] = '\0'; | |
102 } | |
390 | 103 } |
104 | |
105 for (i = 0; sysctls[i].name; i++) { | |
106 size = sysctls[i].size; | |
107 | |
108 if (sysctlbyname(sysctls[i].name, sysctls[i].value, &size, NULL, 0) | |
109 == 0) | |
110 { | |
111 sysctls[i].exists = 1; | |
112 continue; | |
113 } | |
114 | |
115 err = ngx_errno; | |
116 | |
117 if (err == NGX_ENOENT) { | |
118 continue; | |
119 } | |
120 | |
121 ngx_log_error(NGX_LOG_ALERT, log, err, | |
122 "sysctlbyname(%s) failed", sysctls[i].name); | |
123 return NGX_ERROR; | |
124 } | |
125 | |
126 ngx_ncpu = ngx_darwin_hw_ncpu; | |
127 | |
128 somaxconn = 32676; | |
129 | |
130 if (ngx_darwin_kern_ipc_somaxconn > somaxconn) { | |
131 ngx_log_error(NGX_LOG_ALERT, log, 0, | |
132 "sysctl kern.ipc.somaxconn must be no more than %d", | |
133 somaxconn); | |
134 return NGX_ERROR; | |
135 } | |
136 | |
137 ngx_tcp_nodelay_and_tcp_nopush = 1; | |
138 | |
139 ngx_os_io = ngx_darwin_io; | |
140 | |
141 return NGX_OK; | |
142 } | |
143 | |
144 | |
145 void | |
146 ngx_os_specific_status(ngx_log_t *log) | |
147 { | |
148 u_long value; | |
149 ngx_uint_t i; | |
150 | |
418 | 151 if (ngx_darwin_kern_ostype[0]) { |
152 ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s", | |
153 ngx_darwin_kern_ostype, ngx_darwin_kern_osrelease); | |
154 } | |
390 | 155 |
156 for (i = 0; sysctls[i].name; i++) { | |
157 if (sysctls[i].exists) { | |
158 if (sysctls[i].size == sizeof(long)) { | |
159 value = *(long *) sysctls[i].value; | |
160 | |
161 } else { | |
162 value = *(int *) sysctls[i].value; | |
163 } | |
164 | |
165 ngx_log_error(NGX_LOG_NOTICE, log, 0, "%s: %l", | |
166 sysctls[i].name, value); | |
167 } | |
168 } | |
169 } |