Create TCPSession2 for outpubound connections.
This commit is contained in:
1 parent
5c87225c6f
commit
fd70c79282
129 files changed
+1902
-710
No files matched your search
+11
-10
@@ -2,18 +2,19 @@
|
||||
#include "Log.h"
|
||||
|
||||
namespace core {
|
||||
|
||||
|
||||
CommandList::CommandList(std::string delimiter, int depth) : delimiter(delimiter), depth(depth) {}
|
||||
|
||||
|
||||
void CommandList::add(Command &command, std::string name) {
|
||||
commands.insert(std::make_pair(name, &command));
|
||||
}
|
||||
|
||||
|
||||
void CommandList::remove(Command &command) {}
|
||||
|
||||
|
||||
int CommandList::processRequest(coreutils::ZString &request, TCPSession &session) {
|
||||
if(session.grab != NULL)
|
||||
return session.grab->processCommand(request, session);
|
||||
if(session.grab != NULL) {
|
||||
return session.grab->processCommand(request, session);
|
||||
}
|
||||
else {
|
||||
if(request.equals(""))
|
||||
return 0;
|
||||
@@ -29,20 +30,20 @@ namespace core {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CommandList::grabInput(TCPSession &session, Command &command) {
|
||||
session.grab = &command;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CommandList::clearGrab(TCPSession &session) {
|
||||
session.grab = NULL;
|
||||
}
|
||||
|
||||
|
||||
int CommandList::processCommand(coreutils::ZString &request, TCPSession &session) {
|
||||
// for(Command *command : commands)
|
||||
// session.out << command->getName() << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user