mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
初步提交2.0版本,支持虚拟主机
This commit is contained in:
@@ -19,10 +19,10 @@ public:
|
||||
_parser.reset(new OptionParser(nullptr));
|
||||
(*_parser) << Option('l', "list", Option::ArgNone, nullptr,false, "list all media source of rtsp",
|
||||
[](const std::shared_ptr<ostream> &stream, const string &arg) {
|
||||
auto mediaSet = RtspMediaSource::getMediaSet();
|
||||
for (auto &src : mediaSet) {
|
||||
(*stream) << "\t" << src << "\r\n";
|
||||
}
|
||||
// auto mediaSet = RtspMediaSource::getMediaSet();
|
||||
// for (auto &src : mediaSet) {
|
||||
// (*stream) << "\t" << src << "\r\n";
|
||||
// }
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@@ -37,10 +37,10 @@ public:
|
||||
_parser.reset(new OptionParser(nullptr));
|
||||
(*_parser) << Option('l', "list", Option::ArgNone,nullptr,false, "list all media source of rtmp",
|
||||
[](const std::shared_ptr<ostream> &stream, const string &arg) {
|
||||
auto mediaSet = RtmpMediaSource::getMediaSet();
|
||||
for (auto &src : mediaSet) {
|
||||
(*stream) << "\t" << src << "\r\n";
|
||||
}
|
||||
// auto mediaSet = RtmpMediaSource::getMediaSet();
|
||||
// for (auto &src : mediaSet) {
|
||||
// (*stream) << "\t" << src << "\r\n";
|
||||
// }
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -35,15 +35,10 @@ namespace ZL {
|
||||
namespace Shell {
|
||||
|
||||
unordered_map<string, string> ShellSession::g_mapUser;
|
||||
string ShellSession::g_serverName;
|
||||
|
||||
ShellSession::ShellSession(const std::shared_ptr<ThreadPool> &_th,
|
||||
const Socket::Ptr &_sock) :
|
||||
TcpLimitedSession(_th, _sock) {
|
||||
|
||||
static onceToken token([]() {
|
||||
g_serverName = mINI::Instance()[Config::Shell::kServerName];
|
||||
}, nullptr);
|
||||
pleaseInputUser();
|
||||
}
|
||||
|
||||
@@ -107,7 +102,7 @@ inline bool ShellSession::onCommandLine(const string& line) {
|
||||
|
||||
inline void ShellSession::pleaseInputUser() {
|
||||
send("\033[0m");
|
||||
send(StrPrinter << g_serverName << " login: " << endl);
|
||||
send(StrPrinter << SERVER_NAME << " login: " << endl);
|
||||
m_requestCB = [this](const string &line) {
|
||||
m_strUserName=line;
|
||||
pleaseInputPasswd();
|
||||
@@ -121,14 +116,14 @@ inline void ShellSession::pleaseInputPasswd() {
|
||||
send(StrPrinter
|
||||
<<"\033[0mPermission denied,"
|
||||
<<" please try again.\r\n"
|
||||
<<m_strUserName<<"@"<<g_serverName
|
||||
<<m_strUserName<<"@"<<SERVER_NAME
|
||||
<<"'s password: \033[8m"
|
||||
<<endl);
|
||||
return true;
|
||||
}
|
||||
send("\033[0m");
|
||||
send("-----------------------------------------\r\n");
|
||||
send(StrPrinter<<"欢迎来到"<<g_serverName<<", 你可输入\"help\"查看帮助.\r\n"<<endl);
|
||||
send(StrPrinter<<"欢迎来到"<<SERVER_NAME<<", 你可输入\"help\"查看帮助.\r\n"<<endl);
|
||||
send("-----------------------------------------\r\n");
|
||||
printShellPrefix();
|
||||
m_requestCB=nullptr;
|
||||
@@ -137,7 +132,7 @@ inline void ShellSession::pleaseInputPasswd() {
|
||||
}
|
||||
|
||||
inline void ShellSession::printShellPrefix() {
|
||||
send(StrPrinter << m_strUserName << "@" << g_serverName << "# " << endl);
|
||||
send(StrPrinter << m_strUserName << "@" << SERVER_NAME << "# " << endl);
|
||||
}
|
||||
|
||||
inline bool ShellSession::onAuth(const string &user, const string &pwd) {
|
||||
|
||||
@@ -64,7 +64,6 @@ private:
|
||||
string m_strUserName;
|
||||
|
||||
static unordered_map<string, string> g_mapUser;
|
||||
static string g_serverName;
|
||||
};
|
||||
|
||||
} /* namespace Shell */
|
||||
|
||||
Reference in New Issue
Block a user