Permalink
Browse files

use lua_Number instead of lua_Integer for crc32 functions' return val…

…ues because 32-bit signed integers are too short for the crc32 digest.
  • Loading branch information...
agentzh committed Sep 23, 2011
1 parent 0727d20 commit 752be5db1f67605fce3a856dcd9a0a3b928bba76
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/ngx_http_lua_string.c
  2. +1 −1 util/build2.sh
@@ -456,7 +456,7 @@ ngx_http_lua_ngx_crc32_short(lua_State *L)
p = (u_char *) luaL_checklstring(L, 1, &len);
- lua_pushinteger(L, (lua_Integer) ngx_crc32_short(p, len));
+ lua_pushnumber(L, (lua_Number) ngx_crc32_short(p, len));
return 1;
}
@@ -474,7 +474,7 @@ ngx_http_lua_ngx_crc32_long(lua_State *L)
p = (u_char *) luaL_checklstring(L, 1, &len);
- lua_pushinteger(L, (lua_Integer) ngx_crc32_long(p, len));
+ lua_pushnumber(L, (lua_Number) ngx_crc32_long(p, len));
return 1;
}
View
@@ -16,7 +16,7 @@ ngx-build $force $version \
--add-module=$root/../ndk-nginx-module \
--add-module=$root/../set-misc-nginx-module \
--with-cc-opt=$'-O3' \
- --with-ld-opt="-Wl,-rpath=/opt/drizzle/lib:/usr/local/lib:/home/lz/lib:/opt/luajit/lib" \
+ --with-ld-opt="-Wl,-rpath=/opt/drizzle/lib:/usr/local/lib:/home/lz/lib:/usr/local/openresty/luajit/lib" \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \

0 comments on commit 752be5d

Please sign in to comment.