修复media命令相关bug

This commit is contained in:
xiongziliang 2019-05-28 10:02:12 +08:00
parent 7e770841d1
commit 2f976214ce
2 changed files with 27 additions and 28 deletions

View File

@ -45,6 +45,7 @@ public:
return; return;
} }
EventPollerPool::Instance().getPoller()->async([ini,media,stream,schema,vhost,app,streamid](){
if(ini.find("kick") != ini.end()){ if(ini.find("kick") != ini.end()){
//踢出源 //踢出源
do{ do{
@ -68,8 +69,9 @@ public:
<< app << "/" << app << "/"
<< streamid << streamid
<< "\r\n"; << "\r\n";
return;
} }
},false);
}); });
})); }));
@ -86,11 +88,6 @@ public:
} }
}; };
void installShellCMD(){
static onceToken s_token([]() {
REGIST_CMD(media);
}, nullptr);
}

View File

@ -25,18 +25,20 @@
*/ */
#include "ShellSession.h" #include "ShellSession.h"
#include "Common/config.h"
#include "Util/CMD.h" #include "Util/CMD.h"
#include "Util/onceToken.h" #include "Util/onceToken.h"
#include "Util/NoticeCenter.h" #include "Util/NoticeCenter.h"
#include "Common/config.h"
#include "ShellCMD.h"
using namespace toolkit; using namespace toolkit;
namespace mediakit { namespace mediakit {
extern void installShellCMD(); static onceToken s_token([]() {
REGIST_CMD(media);
}, nullptr);
ShellSession::ShellSession(const Socket::Ptr &_sock) : TcpSession(_sock) { ShellSession::ShellSession(const Socket::Ptr &_sock) : TcpSession(_sock) {
installShellCMD();
pleaseInputUser(); pleaseInputUser();
} }