Commit 2f976214 by xiongziliang

修复media命令相关bug

parent 7e770841
...@@ -45,31 +45,33 @@ public: ...@@ -45,31 +45,33 @@ public:
return; return;
} }
if(ini.find("kick") != ini.end()){ EventPollerPool::Instance().getPoller()->async([ini,media,stream,schema,vhost,app,streamid](){
//踢出源 if(ini.find("kick") != ini.end()){
do{ //踢出源
if(!media) { do{
break; if(!media) {
} break;
if(!media->close(true)) { }
break; if(!media->close(true)) {
} break;
(*stream) << "\t踢出成功:" }
(*stream) << "\t踢出成功:"
<< schema << "/"
<< vhost << "/"
<< app << "/"
<< streamid
<< "\r\n";
return;
}while(0);
(*stream) << "\t踢出失败:"
<< schema << "/" << schema << "/"
<< vhost << "/" << vhost << "/"
<< app << "/" << app << "/"
<< streamid << streamid
<< "\r\n"; << "\r\n";
return; }
}while(0); },false);
(*stream) << "\t踢出失败:"
<< schema << "/"
<< vhost << "/"
<< app << "/"
<< streamid
<< "\r\n";
return;
}
}); });
})); }));
...@@ -86,11 +88,6 @@ public: ...@@ -86,11 +88,6 @@ public:
} }
}; };
void installShellCMD(){
static onceToken s_token([]() {
REGIST_CMD(media);
}, nullptr);
}
......
...@@ -25,18 +25,20 @@ ...@@ -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();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论