3
* Gavriloaie Eugen-Andrei (shiretu@gmail.com)
5
* This file is part of crtmpserver.
6
* crtmpserver is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* crtmpserver is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with crtmpserver. If not, see <http://www.gnu.org/licenses/>.
21
#include "vm/lua/luaapi_protocols.h"
22
#include "vm/lua/luaapi_helpers.h"
23
#include "protocols/baseprotocol.h"
24
#include "protocols/protocolmanager.h"
28
int luaapi_protocols_getConfig(lua_State *L) {
29
LUA_INIT_PARAMS(params, L);
30
LUA_READ_PARAM(params, uint32_t, _V_NUMERIC, protocolId, 0, 0, true);
31
LUA_GET_PROTOCOL(pProtocol, protocolId, L);
33
pProtocol->GetStackStats(stackInfo);
34
if (!PushVariant(L, stackInfo)) {
35
FATAL("Unable to push variant");
41
int luaapi_protocols_enqueueForDelete(lua_State *L) {
42
LUA_INIT_PARAMS(params, L);
43
LUA_READ_PARAM(params, uint32_t, _V_NUMERIC, protocolId, 0, 0, true);
44
LUA_GET_PROTOCOL(pProtocol, protocolId, L);
45
pProtocol->EnqueueForDelete();
46
lua_pushboolean(L, true);
50
int luaapi_protocols_gracefullyEnqueueForDelete(lua_State *L) {
51
LUA_INIT_PARAMS(params, L);
52
LUA_READ_PARAM(params, uint32_t, _V_NUMERIC, protocolId, 0, 0, true);
53
LUA_GET_PROTOCOL(pProtocol, protocolId, L);
54
pProtocol->GracefullyEnqueueForDelete();
55
lua_pushboolean(L, true);