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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user