mirror of
https://github.com/apache/httpd.git
synced 2025-08-05 16:55:50 +03:00
Switch from lua_objlen() to Lua 5.2 preferred
lua_rawlen(). Define lua_rawlen() in terms of lua_objlen() when building against older Lua. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612552 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -149,7 +149,7 @@ static int req_aprtable2luatable_cb(void *l, const char *key,
|
|||||||
}
|
}
|
||||||
case LUA_TTABLE:{
|
case LUA_TTABLE:{
|
||||||
/* [array, table<s,t>, table<s,s>] */
|
/* [array, table<s,t>, table<s,s>] */
|
||||||
int size = lua_objlen(L, -1);
|
int size = lua_rawlen(L, -1);
|
||||||
lua_pushnumber(L, size + 1); /* [#, array, table<s,t>, table<s,s>] */
|
lua_pushnumber(L, size + 1); /* [#, array, table<s,t>, table<s,s>] */
|
||||||
lua_pushstring(L, value); /* [string, #, array, table<s,t>, table<s,s>] */
|
lua_pushstring(L, value); /* [string, #, array, table<s,t>, table<s,s>] */
|
||||||
lua_settable(L, -3); /* [array, table<s,t>, table<s,s>] */
|
lua_settable(L, -3); /* [array, table<s,t>, table<s,s>] */
|
||||||
@@ -198,7 +198,7 @@ static int req_aprtable2luatable_cb_len(void *l, const char *key,
|
|||||||
}
|
}
|
||||||
case LUA_TTABLE:{
|
case LUA_TTABLE:{
|
||||||
/* [array, table<s,t>, table<s,s>] */
|
/* [array, table<s,t>, table<s,s>] */
|
||||||
int size = lua_objlen(L, -1);
|
int size = lua_rawlen(L, -1);
|
||||||
lua_pushnumber(L, size + 1); /* [#, array, table<s,t>, table<s,s>] */
|
lua_pushnumber(L, size + 1); /* [#, array, table<s,t>, table<s,s>] */
|
||||||
lua_pushlstring(L, value, len); /* [string, #, array, table<s,t>, table<s,s>] */
|
lua_pushlstring(L, value, len); /* [string, #, array, table<s,t>, table<s,s>] */
|
||||||
lua_settable(L, -3); /* [array, table<s,t>, table<s,s>] */
|
lua_settable(L, -3); /* [array, table<s,t>, table<s,s>] */
|
||||||
|
@@ -52,6 +52,8 @@
|
|||||||
/* Load mode for lua_load() */
|
/* Load mode for lua_load() */
|
||||||
#define lua_load(a,b,c,d) lua_load(a,b,c,d,NULL)
|
#define lua_load(a,b,c,d) lua_load(a,b,c,d,NULL)
|
||||||
#define lua_resume(a,b) lua_resume(a, NULL, b)
|
#define lua_resume(a,b) lua_resume(a, NULL, b)
|
||||||
|
#else
|
||||||
|
#define lua_rawlen(L,i) lua_objlen(L, (i))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Create a set of AP_LUA_DECLARE(type), AP_LUA_DECLARE_NONSTD(type) and
|
/* Create a set of AP_LUA_DECLARE(type), AP_LUA_DECLARE_NONSTD(type) and
|
||||||
|
Reference in New Issue
Block a user