Mercurial > hg > nginx-ranges
view src/core/ngx_crc32.h @ 447:ce4f9ff90bfa NGINX_0_7_31
nginx 0.7.31
*) Change: now the "try_files" directive tests files only and ignores
directories.
*) Feature: the "fastcgi_split_path_info" directive.
*) Bugfixes in an "Expect" request header line support.
*) Bugfixes in geo ranges.
*) Bugfix: in a miss case ngx_http_memcached_module returned the "END"
line as response body instead of default 404 page body; the bug had
appeared in 0.7.18.
Thanks to Maxim Dounin.
*) Bugfix: while SMTP proxying nginx issued message "250 2.0.0 OK"
instead of "235 2.0.0 OK"; the bug had appeared in 0.7.22.
Thanks to Maxim Dounin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 19 Jan 2009 00:00:00 +0300 |
parents | b743d290eb3b |
children |
line wrap: on
line source
/* * Copyright (C) Igor Sysoev */ #ifndef _NGX_CRC32_H_INCLUDED_ #define _NGX_CRC32_H_INCLUDED_ #include <ngx_config.h> #include <ngx_core.h> extern uint32_t *ngx_crc32_table_short; extern uint32_t ngx_crc32_table256[]; static ngx_inline uint32_t ngx_crc32_short(u_char *p, size_t len) { u_char c; uint32_t crc; crc = 0xffffffff; while (len--) { c = *p++; crc = ngx_crc32_table_short[(crc ^ (c & 0xf)) & 0xf] ^ (crc >> 4); crc = ngx_crc32_table_short[(crc ^ (c >> 4)) & 0xf] ^ (crc >> 4); } return crc ^ 0xffffffff; } static ngx_inline uint32_t ngx_crc32_long(u_char *p, size_t len) { uint32_t crc; crc = 0xffffffff; while (len--) { crc = ngx_crc32_table256[(crc ^ *p++) & 0xff] ^ (crc >> 8); } return crc ^ 0xffffffff; } #define ngx_crc32_init(crc) \ crc = 0xffffffff static ngx_inline void ngx_crc32_update(uint32_t *crc, u_char *p, size_t len) { uint32_t c; c = *crc; while (len--) { c = ngx_crc32_table256[(c ^ *p++) & 0xff] ^ (c >> 8); } *crc = c; } #define ngx_crc32_final(crc) \ crc ^= 0xffffffff ngx_int_t ngx_crc32_table_init(void); #endif /* _NGX_CRC32_H_INCLUDED_ */