Mercurial > hg > nginx-vendor-0-5
annotate src/os/unix/ngx_linux_init.c @ 328:26ff8d6b618d NGINX_0_5_34
nginx 0.5.34
*) Change: now the full request line instead of URI only is written to
error_log.
*) Feature: Cygwin compatibility.
Thanks to Vladimir Kutakov.
*) Feature: the "merge_slashes" directive.
*) Feature: the "gzip_vary" directive.
*) Feature: the "server_tokens" directive.
*) Feature: the "access_log" directive may be used inside the
"limit_except" block.
*) Bugfix: if the $server_protocol was used in FastCGI parameters and a
request line length was near to the "client_header_buffer_size"
directive value, then nginx issued an alert "fastcgi: the request
record is too big".
*) Bugfix: if a plain text HTTP/0.9 version request was made to HTTPS
server, then nginx returned usual response.
*) Bugfix: URL double escaping in a redirect of the "msie_refresh"
directive; bug appeared in 0.5.28.
*) Bugfix: a segmentation fault might occur in worker process if
subrequests were used.
*) Bugfix: the big responses may be transferred truncated if SSL and
gzip were used.
*) Bugfix: compatibility with mget.
*) Bugfix: nginx did not unescape URI in the "include" SSI command.
*) Bugfix: the segmentation fault was occurred on start or while
reconfiguration if variable was used in the "charset" or
"source_charset" directives.
*) Bugfix: nginx returned the 400 response on requests like
"GET http://www.domain.com HTTP/1.0".
Thanks to James Oakley.
*) Bugfix: a segmentation fault occurred in worker process if
$date_local and $date_gmt were used outside the
ngx_http_ssi_filter_module.
*) Bugfix: a segmentation fault might occur in worker process if debug
log was enabled.
Thanks to Andrei Nigmatulin.
*) Bugfix: ngx_http_memcached_module did not set
$upstream_response_time.
Thanks to Maxim Dounin.
*) Bugfix: a worker process may got caught in an endless loop, if the
memcached was used.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 13 Dec 2007 00:00:00 +0300 |
parents | 29a6403156b0 |
children | c60beecc6ab5 |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
222 | 11 static ngx_int_t ngx_linux_procfs(char *name, char *buf, size_t len, |
12 ngx_log_t *log); | |
13 | |
0 | 14 |
222 | 15 char ngx_linux_kern_ostype[50]; |
272 | 16 char ngx_linux_kern_osrelease[50]; |
222 | 17 |
18 int ngx_linux_rtsig_max; | |
0 | 19 |
20 | |
88 | 21 static ngx_os_io_t ngx_linux_io = { |
0 | 22 ngx_unix_recv, |
23 ngx_readv_chain, | |
24 ngx_unix_send, | |
18 | 25 #if (NGX_HAVE_SENDFILE) |
0 | 26 ngx_linux_sendfile_chain, |
27 NGX_IO_SENDFILE | |
28 #else | |
29 ngx_writev_chain, | |
30 0 | |
31 #endif | |
32 }; | |
33 | |
34 | |
42 | 35 ngx_int_t |
88 | 36 ngx_os_specific_init(ngx_log_t *log) |
0 | 37 { |
16 | 38 int name[2]; |
39 size_t len; | |
40 ngx_err_t err; | |
0 | 41 |
222 | 42 if (ngx_linux_procfs("/proc/sys/kernel/ostype", |
43 ngx_linux_kern_ostype, | |
44 sizeof(ngx_linux_kern_ostype), log) | |
45 == -1) | |
46 { | |
0 | 47 return NGX_ERROR; |
48 } | |
49 | |
222 | 50 if (ngx_linux_procfs("/proc/sys/kernel/osrelease", |
51 ngx_linux_kern_osrelease, | |
52 sizeof(ngx_linux_kern_osrelease), log) | |
53 == -1) | |
54 { | |
0 | 55 return NGX_ERROR; |
56 } | |
57 | |
58 | |
222 | 59 name[0] = CTL_KERN; |
0 | 60 name[1] = KERN_RTSIGMAX; |
61 len = sizeof(ngx_linux_rtsig_max); | |
42 | 62 |
63 if (sysctl(name, 2, &ngx_linux_rtsig_max, &len, NULL, 0) == -1) { | |
16 | 64 err = ngx_errno; |
65 | |
222 | 66 if (err != NGX_ENOTDIR && err != NGX_ENOSYS) { |
16 | 67 ngx_log_error(NGX_LOG_ALERT, log, err, |
68 "sysctl(KERN_RTSIGMAX) failed"); | |
69 | |
70 return NGX_ERROR; | |
71 } | |
72 | |
0 | 73 ngx_linux_rtsig_max = 0; |
74 } | |
75 | |
76 | |
88 | 77 ngx_os_io = ngx_linux_io; |
78 | |
79 return NGX_OK; | |
0 | 80 } |
81 | |
82 | |
42 | 83 void |
88 | 84 ngx_os_specific_status(ngx_log_t *log) |
0 | 85 { |
80 | 86 ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s", |
0 | 87 ngx_linux_kern_ostype, ngx_linux_kern_osrelease); |
88 | |
80 | 89 ngx_log_error(NGX_LOG_NOTICE, log, 0, "sysctl(KERN_RTSIGMAX): %d", |
0 | 90 ngx_linux_rtsig_max); |
91 } | |
222 | 92 |
93 | |
94 static ngx_int_t | |
95 ngx_linux_procfs(char *name, char *buf, size_t len, ngx_log_t *log) | |
96 { | |
97 int n; | |
98 ngx_fd_t fd; | |
99 | |
100 fd = open(name, O_RDONLY); | |
101 | |
102 if (fd == NGX_INVALID_FILE) { | |
103 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | |
104 "open(\"%s\") failed", name); | |
105 | |
106 return NGX_ERROR; | |
107 } | |
108 | |
109 n = read(fd, buf, len); | |
110 | |
111 if (n == -1) { | |
112 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | |
113 "read(\"%s\") failed", name); | |
114 | |
115 } else { | |
116 if (buf[n - 1] == '\n') { | |
117 buf[--n] = '\0'; | |
118 } | |
119 } | |
120 | |
121 ngx_close_file(fd); | |
122 | |
123 return n; | |
124 } |