1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Support build for Lua 5.1 (for LuaJIT), Lua 5.2 and Lua 5.3 (Step 5/?)

See #195
This commit is contained in:
bel2125
2015-08-22 23:10:58 +02:00
parent 5197106e0a
commit 19b7e4d12e
4 changed files with 17 additions and 10 deletions

View File

@@ -1145,12 +1145,18 @@ static void prepare_lua_environment(struct mg_context *ctx,
{
civetweb_open_lua_libs(L);
#if LUA_VERSION_NUM == 502
/* Keep the "connect" method for compatibility,
* but do not backport it to Lua 5.1.
* TODO: Redesign the interface.
*/
luaL_newmetatable(L, LUASOCKET);
lua_pushliteral(L, "__index");
luaL_newlib(L, luasocket_methods);
lua_rawset(L, -3);
lua_pop(L, 1);
lua_register(L, "connect", lsp_connect);
#endif
/* Store context in the registry */
if (ctx != NULL) {