Mercurial > hg > nginx-vendor-current
annotate src/core/ngx_crc32.h @ 256:2e9c57a5e50a NGINX_0_4_13
nginx 0.4.13
*) Feature: the "proxy_pass" directive may be used inside the
"limit_except" block.
*) Feature: the "limit_except" directive supports all WebDAV methods.
*) Bugfix: if the "add_before_body" directive was used without the
"add_after_body" directive, then an response did not transferred
complete.
*) Bugfix: a large request body did not receive if the epoll method and
the deferred accept() were used.
*) Bugfix: a charset could not be set for ngx_http_autoindex_module
responses; bug appeared in 0.3.50.
*) Bugfix: the "[alert] zero size buf" error when FastCGI server was
used;
*) Bugfix: the --group= configuration parameter was ignored.
Thanks to Thomas Moschny.
*) Bugfix: the 50th subrequest in SSI response did not work; bug
appeared in 0.3.50.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 15 Nov 2006 00:00:00 +0300 |
parents | fbf2b2f66c9f |
children | 6eb1e38f0f1f |
rev | line source |
---|---|
250 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #ifndef _NGX_CRC32_H_INCLUDED_ | |
8 #define _NGX_CRC32_H_INCLUDED_ | |
9 | |
10 | |
11 #include <ngx_config.h> | |
12 #include <ngx_core.h> | |
13 | |
14 | |
15 extern uint32_t *ngx_crc32_table_short; | |
16 extern uint32_t ngx_crc32_table256[]; | |
17 | |
18 | |
19 static ngx_inline uint32_t | |
20 ngx_crc32_short(u_char *p, size_t len) | |
21 { | |
22 u_char c; | |
23 uint32_t crc; | |
24 | |
25 crc = 0xffffffff; | |
26 | |
27 while (len--) { | |
28 c = *p++; | |
29 crc = ngx_crc32_table_short[(crc ^ (c & 0xf)) & 0xf] ^ (crc >> 4); | |
30 crc = ngx_crc32_table_short[(crc ^ (c >> 4)) & 0xf] ^ (crc >> 4); | |
31 } | |
32 | |
33 return crc ^ 0xffffffff; | |
34 } | |
35 | |
36 | |
37 static ngx_inline uint32_t | |
38 ngx_crc32_long(u_char *p, size_t len) | |
39 { | |
40 uint32_t crc; | |
41 | |
42 crc = 0xffffffff; | |
43 | |
44 while (len--) { | |
45 crc = ngx_crc32_table256[(crc ^ *p++) & 0xff] ^ (crc >> 8); | |
46 } | |
47 | |
48 return crc ^ 0xffffffff; | |
49 } | |
50 | |
51 | |
52 ngx_int_t ngx_crc32_init(ngx_pool_t *pool); | |
53 | |
54 | |
55 #endif /* _NGX_CRC32_H_INCLUDED_ */ |