comparison src/os/unix/ngx_freebsd_init.c @ 646:615b5ea36fc0 NGINX_1_1_7

nginx 1.1.7 *) Feature: support of several resolvers in the "resolver" directive. Thanks to Kirill A. Korinskiy. *) Bugfix: a segmentation fault occurred on start or while reconfiguration if the "ssl" directive was used at http level and there was no "ssl_certificate" defined. *) Bugfix: reduced memory consumption while proxying of big files if they were buffered to disk. *) Bugfix: a segmentation fault might occur in a worker process if "proxy_http_version 1.1" directive was used. *) Bugfix: in the "expires @time" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 31 Oct 2011 00:00:00 +0400
parents fd759445d8a8
children d0f7a625f27c
comparison
equal deleted inserted replaced
645:e461dead01e9 646:615b5ea36fc0
20 int ngx_freebsd_machdep_hlt_logical_cpus; 20 int ngx_freebsd_machdep_hlt_logical_cpus;
21 21
22 22
23 ngx_uint_t ngx_freebsd_sendfile_nbytes_bug; 23 ngx_uint_t ngx_freebsd_sendfile_nbytes_bug;
24 ngx_uint_t ngx_freebsd_use_tcp_nopush; 24 ngx_uint_t ngx_freebsd_use_tcp_nopush;
25 ngx_uint_t ngx_freebsd_debug_malloc; 25
26 ngx_uint_t ngx_debug_malloc;
26 27
27 28
28 static ngx_os_io_t ngx_freebsd_io = { 29 static ngx_os_io_t ngx_freebsd_io = {
29 ngx_unix_recv, 30 ngx_unix_recv,
30 ngx_readv_chain, 31 ngx_readv_chain,
78 _malloc_options = "J"; 79 _malloc_options = "J";
79 #else 80 #else
80 malloc_options = "J"; 81 malloc_options = "J";
81 #endif 82 #endif
82 83
83 ngx_freebsd_debug_malloc = 1; 84 ngx_debug_malloc = 1;
84 85
85 #else 86 #else
86 char *mo; 87 char *mo;
87 88
88 mo = getenv("MALLOC_OPTIONS"); 89 mo = getenv("MALLOC_OPTIONS");
89 90
90 if (mo && ngx_strchr(mo, 'J')) { 91 if (mo && ngx_strchr(mo, 'J')) {
91 ngx_freebsd_debug_malloc = 1; 92 ngx_debug_malloc = 1;
92 } 93 }
93 #endif 94 #endif
94 } 95 }
95 96
96 97
97 ngx_int_t 98 ngx_int_t
98 ngx_os_specific_init(ngx_log_t *log) 99 ngx_os_specific_init(ngx_log_t *log)
99 { 100 {
100 int version, somaxconn; 101 int version;
101 size_t size; 102 size_t size;
102 ngx_err_t err; 103 ngx_err_t err;
103 ngx_uint_t i; 104 ngx_uint_t i;
104 105
105 size = sizeof(ngx_freebsd_kern_ostype); 106 size = sizeof(ngx_freebsd_kern_ostype);
207 208
208 } else { 209 } else {
209 ngx_ncpu = ngx_freebsd_hw_ncpu; 210 ngx_ncpu = ngx_freebsd_hw_ncpu;
210 } 211 }
211 212
212 somaxconn = version < 600008 ? 32676 : 65535; 213 if (version < 600008 && ngx_freebsd_kern_ipc_somaxconn > 32767) {
213
214 if (ngx_freebsd_kern_ipc_somaxconn > somaxconn) {
215 ngx_log_error(NGX_LOG_ALERT, log, 0, 214 ngx_log_error(NGX_LOG_ALERT, log, 0,
216 "sysctl kern.ipc.somaxconn must be no more than %d", 215 "sysctl kern.ipc.somaxconn must be less than 32768");
217 somaxconn);
218 return NGX_ERROR; 216 return NGX_ERROR;
219 } 217 }
220 218
221 ngx_tcp_nodelay_and_tcp_nopush = 1; 219 ngx_tcp_nodelay_and_tcp_nopush = 1;
222 220