annotate src/core/ngx_murmurhash.h @ 7355:b64adc956643

Rewrite: removed r->err_status special handling (ticket #1634). Trying to look into r->err_status in the "return" directive makes it behave differently than real errors generated in other parts of the code, and is an endless source of various problems. This behaviour was introduced in 726:7b71936d5299 (0.4.4) with the comment "fix: "return" always overrode "error_page" response code". It is not clear if there were any real cases this was expected to fix, but there are several cases which are broken due to this change, some previously fixed (4147:7f64de1cc2c0). In ticket #1634, the problem is that when r->err_status is set to a non-special status code, it is not possible to return a response by simply returning r->err_status. If this is the case, the only option is to return script's e->status instead. An example configuration: location / { error_page 404 =200 /err502; return 404; } location = /err502 { return 502; } After the change, such a configuration will properly return standard 502 error, much like it happens when a 502 error is generated by proxy_pass. This also fixes the following configuration to properly close connection as clearly requested by "return 444": location / { error_page 404 /close; return 404; } location = /close { return 444; } Previously, this required "error_page 404 = /close;" to work as intended.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 21 Sep 2018 15:59:33 +0300
parents 709d7d24239d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3891
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 /*
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 3891
diff changeset
4 * Copyright (C) Nginx, Inc.
3891
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 */
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #ifndef _NGX_MURMURHASH_H_INCLUDED_
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #define _NGX_MURMURHASH_H_INCLUDED_
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 #include <ngx_config.h>
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 #include <ngx_core.h>
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 uint32_t ngx_murmur_hash2(u_char *data, size_t len);
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17
203eb026ec07 ngx_murmur_hash2()
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
4575
709d7d24239d Comment fixed.
Andrey Belov <defan@nginx.com>
parents: 4412
diff changeset
19 #endif /* _NGX_MURMURHASH_H_INCLUDED_ */