示例#1
0
文件: HttpLua.cpp 项目: txal/XProject
static void ProcessHttpRequest()
{
	HTTPMSG* poMsg = goHttpServer.GetRequest();
	if (poMsg == NULL)
	{
		return;
	}

	LuaWrapper* poLuaWrapper = LuaWrapper::Instance();
	lua_State* pState = poLuaWrapper->GetLuaState();

	lua_pushlightuserdata(pState, poMsg->c);
	lua_pushstring(pState, poMsg->data.c_str());
	lua_pushinteger(pState, poMsg->type);
	lua_pushstring(pState, poMsg->url.c_str());
	poLuaWrapper->CallLuaRef("HttpRequestMessage", 4, 0);
	SAFE_DELETE(poMsg);
}