Explorar el Código

timestamp validity now initialised in IoMan

Denys hace 4 años
padre
commit
5ee547d5e6
Se han modificado 3 ficheros con 12 adiciones y 7 borrados
  1. 6 0
      cli/include/ioman.h
  2. 1 1
      cli/src/ioman.cpp
  3. 5 6
      cli/src/userioman.cpp

+ 6 - 0
cli/include/ioman.h

@@ -85,9 +85,15 @@ protected:
 	CmdMan cmdman;
 	FileMan fileman;
 
+	/**
+	 * Functions used to handle results produced by CmdMan for user input or network input
+	 */
 	virtual void handleInCmdResponse(CmdMan::CmdRet cmdret);
 	virtual void handleOutCmdResponse(CmdMan::CmdRet cmdret, vector<string> &toput);
 
+	/**
+	 * Boost asio sockets used for tcp and ssl communication and flag wether to use ssl or not
+	 */
 	tcp::socket *tcpsock;
 	boost::asio::ssl::stream<tcp::socket &> *sslsock;
 	bool usessl;

+ 1 - 1
cli/src/ioman.cpp

@@ -31,7 +31,7 @@ IoMan::IoMan(bool enablessl, const char *certfile) : cmdman(fileman, &ioman_exte
 	tcpsock = new tcp::socket(ios);
 	connected = false;
 
-	/* to be put elsewhere */
+	sendtimestampValid = false;
 
 	/* setup json stuff */
 	Json::CharReaderBuilder rbuilder;

+ 5 - 6
cli/src/userioman.cpp

@@ -43,7 +43,6 @@ void UserIoMan::printMessage(std::string msg, OutMsgType type) {
 	Json::Value root;
 	vector<string>::const_iterator connectit;
 
-
 	switch (type) {
 	case normal:
 	case error: {
@@ -58,13 +57,13 @@ void UserIoMan::printMessage(std::string msg, OutMsgType type) {
 	case debug: {
 		if (verbose) {
 			msgmutex.lock();
-			
+
 			char *savedline = rl_copy_text(0, rl_end);
 			int savedpoint = rl_point;
 			rl_set_prompt("");
 			rl_replace_line("", 0);
 			rl_redisplay();
-			
+
 			std::cerr << msg << std::endl;
 
 			rl_set_prompt(getCmdPrompt().c_str());
@@ -98,13 +97,13 @@ void UserIoMan::printJson(Json::Value root) {
 		return;
 	}
 	msgmutex.lock();
-	
+
 	char *savedline = rl_copy_text(0, rl_end);
 	int savedpoint = rl_point;
 	rl_set_prompt("");
 	rl_replace_line("", 0);
 	rl_redisplay();
-	
+
 	(this->*(printmap[root["command"].asString()]))(root);
 
 	rl_set_prompt(getCmdPrompt().c_str());
@@ -112,7 +111,7 @@ void UserIoMan::printJson(Json::Value root) {
 	rl_point = savedpoint;
 	rl_redisplay();
 	free(savedline);
-	
+
 	msgmutex.unlock();
 }