comparison src/os/unix/ngx_freebsd_init.c @ 501:d4ea69372b94 release-0.1.25

nginx-0.1.25-RELEASE import *) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author Igor Sysoev <igor@sysoev.ru>
date Sat, 19 Mar 2005 12:38:37 +0000
parents 8e8f3af115b5
children c3bd8cdabb8f
comparison
equal deleted inserted replaced
500:9a0f304470f5 501:d4ea69372b94
12 char ngx_freebsd_kern_ostype[16]; 12 char ngx_freebsd_kern_ostype[16];
13 char ngx_freebsd_kern_osrelease[128]; 13 char ngx_freebsd_kern_osrelease[128];
14 int ngx_freebsd_kern_osreldate; 14 int ngx_freebsd_kern_osreldate;
15 int ngx_freebsd_hw_ncpu; 15 int ngx_freebsd_hw_ncpu;
16 int ngx_freebsd_net_inet_tcp_sendspace; 16 int ngx_freebsd_net_inet_tcp_sendspace;
17 int ngx_freebsd_kern_ipc_somaxconn;
17 18
18 /* FreeBSD 4.9 */ 19 /* FreeBSD 4.9 */
19 int ngx_freebsd_machdep_hlt_logical_cpus; 20 int ngx_freebsd_machdep_hlt_logical_cpus;
20 21
21 /* FreeBSD 5.0 */ 22 /* FreeBSD 5.0 */
59 60
60 { "net.inet.tcp.sendspace", 61 { "net.inet.tcp.sendspace",
61 &ngx_freebsd_net_inet_tcp_sendspace, 62 &ngx_freebsd_net_inet_tcp_sendspace,
62 sizeof(int), 0 }, 63 sizeof(int), 0 },
63 64
65 { "kern.ipc.somaxconn",
66 &ngx_freebsd_kern_ipc_somaxconn,
67 sizeof(int), 0 },
68
64 { "kern.ipc.zero_copy.send", 69 { "kern.ipc.zero_copy.send",
65 &ngx_freebsd_kern_ipc_zero_copy_send, 70 &ngx_freebsd_kern_ipc_zero_copy_send,
66 sizeof(int), 0 }, 71 sizeof(int), 0 },
67 72
68 { NULL, NULL, 0, 0 } 73 { NULL, NULL, 0, 0 }
83 } 88 }
84 89
85 90
86 ngx_int_t ngx_os_init(ngx_log_t *log) 91 ngx_int_t ngx_os_init(ngx_log_t *log)
87 { 92 {
88 int version; 93 int version, somaxconn;
89 size_t size; 94 size_t size;
90 ngx_err_t err; 95 ngx_err_t err;
91 ngx_uint_t i; 96 ngx_uint_t i;
92 97
93 size = sizeof(ngx_freebsd_kern_ostype); 98 size = sizeof(ngx_freebsd_kern_ostype);
201 ngx_ncpu = ngx_freebsd_hw_ncpu / 2; 206 ngx_ncpu = ngx_freebsd_hw_ncpu / 2;
202 } else { 207 } else {
203 ngx_ncpu = ngx_freebsd_hw_ncpu; 208 ngx_ncpu = ngx_freebsd_hw_ncpu;
204 } 209 }
205 210
211 if (version < 600008) {
212 somaxconn = 32767;
213 } else {
214 somaxconn = 65535;
215 }
216
217 if (ngx_freebsd_kern_ipc_somaxconn > somaxconn) {
218 ngx_log_error(NGX_LOG_ALERT, log, 0,
219 "sysctl kern.ipc.somaxconn must be no more than %d",
220 somaxconn);
221 return NGX_ERROR;
222 }
206 223
207 ngx_tcp_nodelay_and_tcp_nopush = 1; 224 ngx_tcp_nodelay_and_tcp_nopush = 1;
208 225
209 226
210 return ngx_posix_init(log); 227 return ngx_posix_init(log);