return 1;
}
-int ModApiHttp::l_set_http_api_lua(lua_State *L)
-{
- NO_MAP_LOCK_REQUIRED;
-
- // This is called by builtin to give us a function that will later
- // populate the http_api table with additional method(s).
- // We need this because access to the HTTP api is security-relevant and
- // any mod could just mess with a global variable.
- luaL_checktype(L, 1, LUA_TFUNCTION);
- lua_rawseti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_HTTP_API_LUA);
-
- return 0;
-}
-
int ModApiHttp::l_request_http_api(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
#endif
+int ModApiHttp::l_set_http_api_lua(lua_State *L)
+{
+ NO_MAP_LOCK_REQUIRED;
+
+#if USE_CURL
+ // This is called by builtin to give us a function that will later
+ // populate the http_api table with additional method(s).
+ // We need this because access to the HTTP api is security-relevant and
+ // any mod could just mess with a global variable.
+ luaL_checktype(L, 1, LUA_TFUNCTION);
+ lua_rawseti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_HTTP_API_LUA);
+#endif
+
+ return 0;
+}
+
void ModApiHttp::Initialize(lua_State *L, int top)
{
#if USE_CURL
API_FCT(set_http_api_lua);
}
+#else
+
+ // Define this function anyway so builtin can call it without checking
+ API_FCT(set_http_api_lua);
+
#endif
}
// http_fetch_async_get(handle)
static int l_http_fetch_async_get(lua_State *L);
- // set_http_api_lua() [internal]
- static int l_set_http_api_lua(lua_State *L);
-
// request_http_api()
static int l_request_http_api(lua_State *L);
static int l_get_http_api(lua_State *L);
#endif
+ // set_http_api_lua() [internal]
+ static int l_set_http_api_lua(lua_State *L);
+
+
public:
static void Initialize(lua_State *L, int top);
static void InitializeAsync(lua_State *L, int top);