Mercurial > hg > nginx-vendor-1-0
annotate src/os/unix/ngx_errno.c @ 644:ad25218fd14b NGINX_1_0_12
nginx 1.0.12
*) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
"ssl_protocols" directive.
*) Feature: the "if" SSI command supports captures in regular
expressions.
*) Bugfix: the "if" SSI command did not work inside the "block" command.
*) Bugfix: in AIO error handling on FreeBSD.
*) Bugfix: in the OpenSSL library initialization.
*) Bugfix: the "worker_cpu_affinity" directive might not work.
*) Bugfix: the "limit_conn_log_level" and "limit_req_log_level"
directives might not work.
*) Bugfix: the "read_ahead" directive might not work combined with
"try_files" and "open_file_cache".
*) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter
did not return answer from cache if there were no live upstreams.
*) Bugfix: a segmentation fault might occur in a worker process if small
time was used in the "inactive" parameter of the "proxy_cache_path"
directive.
*) Bugfix: responses from cache might hang.
*) Bugfix: in error handling while connecting to a backend.
Thanks to Piotr Sikora.
*) Bugfix: in the "epoll" event method.
Thanks to Yichun Zhang.
*) Bugfix: the $sent_http_cache_control variable might contain a wrong
value if the "expires" directive was used.
Thanks to Yichun Zhang.
*) Bugfix: the "limit_rate" directive did not allow to use full
throughput, even if limit value was very high.
*) Bugfix: the "sendfile_max_chunk" directive did not work, if the
"limit_rate" directive was used.
*) Bugfix: nginx could not be built on Solaris; the bug had appeared in
1.0.11.
*) Bugfix: in the ngx_http_scgi_module.
*) Bugfix: in the ngx_http_mp4_module.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 06 Feb 2012 00:00:00 +0400 |
parents | 692f4d4d7f10 |
children |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
644 | 4 * Copyright (C) Nginx, Inc. |
0 | 5 */ |
6 | |
7 | |
8 #include <ngx_config.h> | |
9 #include <ngx_core.h> | |
10 | |
11 | |
604 | 12 /* |
13 * The strerror() messages are copied because: | |
14 * | |
15 * 1) strerror() and strerror_r() functions are not Async-Signal-Safe, | |
638 | 16 * therefore, they cannot be used in signal handlers; |
604 | 17 * |
18 * 2) a direct sys_errlist[] array may be used instead of these functions, | |
19 * but Linux linker warns about its usage: | |
20 * | |
21 * warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead | |
22 * warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead | |
23 * | |
24 * causing false bug reports. | |
25 */ | |
0 | 26 |
27 | |
604 | 28 static ngx_str_t *ngx_sys_errlist; |
29 static ngx_str_t ngx_unknown_error = ngx_string("Unknown error"); | |
0 | 30 |
31 | |
422 | 32 u_char * |
604 | 33 ngx_strerror(ngx_err_t err, u_char *errstr, size_t size) |
34 { | |
35 ngx_str_t *msg; | |
36 | |
37 msg = ((ngx_uint_t) err < NGX_SYS_NERR) ? &ngx_sys_errlist[err]: | |
38 &ngx_unknown_error; | |
39 size = ngx_min(size, msg->len); | |
40 | |
41 return ngx_cpymem(errstr, msg->data, size); | |
42 } | |
43 | |
44 | |
45 ngx_uint_t | |
46 ngx_strerror_init(void) | |
0 | 47 { |
604 | 48 char *msg; |
49 u_char *p; | |
50 size_t len; | |
51 ngx_err_t err; | |
0 | 52 |
604 | 53 /* |
54 * ngx_strerror() is not ready to work at this stage, therefore, | |
55 * malloc() is used and possible errors are logged using strerror(). | |
56 */ | |
57 | |
58 len = NGX_SYS_NERR * sizeof(ngx_str_t); | |
59 | |
60 ngx_sys_errlist = malloc(len); | |
61 if (ngx_sys_errlist == NULL) { | |
62 goto failed; | |
0 | 63 } |
64 | |
604 | 65 for (err = 0; err < NGX_SYS_NERR; err++) { |
66 msg = strerror(err); | |
67 len = ngx_strlen(msg); | |
0 | 68 |
604 | 69 p = malloc(len); |
70 if (p == NULL) { | |
71 goto failed; | |
72 } | |
0 | 73 |
604 | 74 ngx_memcpy(p, msg, len); |
75 ngx_sys_errlist[err].len = len; | |
76 ngx_sys_errlist[err].data = p; | |
0 | 77 } |
78 | |
604 | 79 return NGX_OK; |
80 | |
81 failed: | |
0 | 82 |
604 | 83 err = errno; |
84 ngx_log_stderr(0, "malloc(%uz) failed (%d: %s)", len, err, strerror(err)); | |
85 | |
86 return NGX_ERROR; | |
0 | 87 } |