Skip to content

Commit

Permalink
update lua header nginx 1.11.11+ compat patch for 0.10.8 in 123.09beta01
Browse files Browse the repository at this point in the history
  • Loading branch information
centminmod committed Apr 9, 2017
1 parent 7cd4501 commit 669aae5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
11 changes: 9 additions & 2 deletions inc/nginx_patch.inc
Expand Up @@ -6,7 +6,7 @@ luanginx_patch() {
DETECT_NGXVER=$(awk '/define nginx_version / {print $3}' "/svr-setup/nginx-${NGINX_VERSION}/src/core/nginx.h")
echo "$DETECT_NGXVER"
fi
if [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.7' ]]; then
if [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.7' ]] || [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.8' ]]; then
NGX_LUANGINXDIR=$(tar -tzf "$DIR_TMP/${NGX_LUANGINXLINKFILE}" | head -1 | cut -f1 -d"/")
pushd "${DIR_TMP}/${NGX_LUANGINXDIR}/src"
rm -rf ngx_http_lua_headers.c
Expand All @@ -16,13 +16,20 @@ luanginx_patch() {
echo "patching lua nginx module for nginx 1.11.11+"
popd
fi
if [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.7' ]] || [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.8' ]]; then
if [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.7' ]]; then
pushd "${DIR_TMP}/${NGX_LUANGINXDIR}/src"
cecho "patching lua nginx 0.10.7 for community.centminmod.com/posts/47450/" $boldyellow
cecho "patch -p0 < $CUR_DIR/patches/luanginx/luanginx-0107.patch" $boldyellow
patch -p0 < "$CUR_DIR/patches/luanginx/luanginx-0107.patch"
popd
fi
if [[ "$ORESTY_LUANGINX" = [yY] && "$DETECT_NGXVER" -ge '1011011' && "$ORESTY_LUANGINXVER" = '0.10.8' ]]; then
pushd "${DIR_TMP}/${NGX_LUANGINXDIR}/src"
cecho "patching lua nginx 0.10.8 for community.centminmod.com/posts/47450/" $boldyellow
cecho "patch -p0 < $CUR_DIR/patches/luanginx/luanginx-0108.patch" $boldyellow
patch -p0 < "$CUR_DIR/patches/luanginx/luanginx-0108.patch"
popd
fi
}

echonginx_patch() {
Expand Down
19 changes: 19 additions & 0 deletions patches/luanginx/luanginx-0108.patch
@@ -0,0 +1,19 @@
--- ngx_http_lua_headers.c 2017-04-09 07:25:36.938834678 +0000
+++ ngx_http_lua_headers.c.new 2017-04-09 07:30:13.209948670 +0000
@@ -771,7 +771,7 @@
ngx_str_null(&value);

} else if (lua_type(L, 3) == LUA_TTABLE) {
- n = luaL_getn(L, 3);
+ n = lua_objlen(L, 3);
if (n == 0) {
ngx_str_null(&value);

@@ -905,7 +905,7 @@
ngx_str_null(&value);

} else if (lua_type(L, 2) == LUA_TTABLE) {
- n = luaL_getn(L, 2);
+ n = lua_objlen(L, 2);
if (n == 0) {
ngx_str_null(&value);

0 comments on commit 669aae5

Please sign in to comment.