Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_linux_init.c @ 674:4dcaf40cc702 NGINX_1_3_0
nginx 1.3.0
*) Feature: the "debug_connection" directive now supports IPv6 addresses
and the "unix:" parameter.
*) Feature: the "set_real_ip_from" directive and the "proxy" parameter
of the "geo" directive now support IPv6 addresses.
*) Feature: the "real_ip_recursive", "geoip_proxy", and
"geoip_proxy_recursive" directives.
*) Feature: the "proxy_recursive" parameter of the "geo" directive.
*) Bugfix: a segmentation fault might occur in a worker process if the
"resolver" directive was used.
*) Bugfix: a segmentation fault might occur in a worker process if the
"fastcgi_pass", "scgi_pass", or "uwsgi_pass" directives were used and
backend returned incorrect response.
*) Bugfix: a segmentation fault might occur in a worker process if the
"rewrite" directive was used and new request arguments in a
replacement used variables.
*) Bugfix: nginx might hog CPU if the open file resource limit was
reached.
*) Bugfix: nginx might loop infinitely over backends if the
"proxy_next_upstream" directive with the "http_404" parameter was
used and there were backup servers specified in an upstream block.
*) Bugfix: adding the "down" parameter of the "server" directive might
cause unneeded client redistribution among backend servers if the
"ip_hash" directive was used.
*) Bugfix: socket leak.
Thanks to Yichun Zhang.
*) Bugfix: in the ngx_http_fastcgi_module.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 15 May 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 | |
344 | 12 u_char ngx_linux_kern_ostype[50]; |
13 u_char ngx_linux_kern_osrelease[50]; | |
222 | 14 |
366 | 15 int ngx_linux_rtsig_max; |
0 | 16 |
17 | |
88 | 18 static ngx_os_io_t ngx_linux_io = { |
0 | 19 ngx_unix_recv, |
20 ngx_readv_chain, | |
354 | 21 ngx_udp_unix_recv, |
0 | 22 ngx_unix_send, |
18 | 23 #if (NGX_HAVE_SENDFILE) |
0 | 24 ngx_linux_sendfile_chain, |
25 NGX_IO_SENDFILE | |
26 #else | |
27 ngx_writev_chain, | |
28 0 | |
29 #endif | |
30 }; | |
31 | |
32 | |
42 | 33 ngx_int_t |
88 | 34 ngx_os_specific_init(ngx_log_t *log) |
0 | 35 { |
344 | 36 struct utsname u; |
0 | 37 |
344 | 38 if (uname(&u) == -1) { |
39 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "uname() failed"); | |
0 | 40 return NGX_ERROR; |
41 } | |
42 | |
344 | 43 (void) ngx_cpystrn(ngx_linux_kern_ostype, (u_char *) u.sysname, |
44 sizeof(ngx_linux_kern_ostype)); | |
0 | 45 |
344 | 46 (void) ngx_cpystrn(ngx_linux_kern_osrelease, (u_char *) u.release, |
47 sizeof(ngx_linux_kern_osrelease)); | |
0 | 48 |
366 | 49 #if (NGX_HAVE_RTSIG) |
50 { | |
51 int name[2]; | |
52 size_t len; | |
53 ngx_err_t err; | |
54 | |
222 | 55 name[0] = CTL_KERN; |
0 | 56 name[1] = KERN_RTSIGMAX; |
57 len = sizeof(ngx_linux_rtsig_max); | |
42 | 58 |
59 if (sysctl(name, 2, &ngx_linux_rtsig_max, &len, NULL, 0) == -1) { | |
16 | 60 err = ngx_errno; |
61 | |
222 | 62 if (err != NGX_ENOTDIR && err != NGX_ENOSYS) { |
16 | 63 ngx_log_error(NGX_LOG_ALERT, log, err, |
64 "sysctl(KERN_RTSIGMAX) failed"); | |
65 | |
66 return NGX_ERROR; | |
67 } | |
68 | |
0 | 69 ngx_linux_rtsig_max = 0; |
70 } | |
71 | |
366 | 72 } |
73 #endif | |
0 | 74 |
88 | 75 ngx_os_io = ngx_linux_io; |
76 | |
77 return NGX_OK; | |
0 | 78 } |
79 | |
80 | |
42 | 81 void |
88 | 82 ngx_os_specific_status(ngx_log_t *log) |
0 | 83 { |
80 | 84 ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s", |
0 | 85 ngx_linux_kern_ostype, ngx_linux_kern_osrelease); |
86 | |
366 | 87 #if (NGX_HAVE_RTSIG) |
80 | 88 ngx_log_error(NGX_LOG_NOTICE, log, 0, "sysctl(KERN_RTSIGMAX): %d", |
0 | 89 ngx_linux_rtsig_max); |
366 | 90 #endif |
0 | 91 } |