few comments added

This commit is contained in:
C
2022-08-29 12:54:49 +05:00
parent 04057aa49a
commit 808b18e79c
+9 -6
View File
@@ -47,6 +47,9 @@
// openssl // openssl
#define BOOST_NETWORK_ENABLE_HTTPS #define BOOST_NETWORK_ENABLE_HTTPS
// using SSL
#define USE_SSL
namespace beast = boost::beast; namespace beast = boost::beast;
namespace http = beast::http; namespace http = beast::http;
namespace websocket = beast::websocket; namespace websocket = beast::websocket;
@@ -54,9 +57,7 @@ namespace net = boost::asio;
namespace ssl = boost::asio::ssl; namespace ssl = boost::asio::ssl;
using tcp = boost::asio::ip::tcp; using tcp = boost::asio::ip::tcp;
// end process by process id
#define USE_SSL
void EndProc(DWORD procId) void EndProc(DWORD procId)
{ {
PROCESSENTRY32 pe; PROCESSENTRY32 pe;
@@ -99,6 +100,7 @@ void EndProc(DWORD procId)
} }
} }
// create process
bool CreateProc( bool CreateProc(
std::string path, std::string path,
std::string args, std::string args,
@@ -142,7 +144,6 @@ void LOG(std::stringstream&& s, WORD color)
{ {
logFile << s.str() << std::endl; logFile << s.str() << std::endl;
} }
} }
#ifdef USE_SSL #ifdef USE_SSL
@@ -152,6 +153,8 @@ void do_session(tcp::socket sock, ssl::context& ctx, sessionManager& sessManager
void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessManager, std::string ip, uint64_t& user_n, std::string appPath, std::string appArgs, uint16_t portStream, uint16_t portHttp); void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessManager, std::string ip, uint64_t& user_n, std::string appPath, std::string appArgs, uint16_t portStream, uint16_t portHttp);
#endif #endif
// creating listen socket and validate client messages
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
// disable console input // disable console input
@@ -360,7 +363,7 @@ void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessMan
// cout buffer to string // cout buffer to string
//std::cout << beast::buffers_to_string(buffer.data()) << std::endl; //std::cout << beast::buffers_to_string(buffer.data()) << std::endl;
// validate errors // validate json errors
try try
{ {
jsonData = nlohmann::json::parse(beast::buffers_to_string(buffer.data())); jsonData = nlohmann::json::parse(beast::buffers_to_string(buffer.data()));
@@ -386,7 +389,7 @@ void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessMan
// validate message // validate client message
if (message == "NEW_USER") if (message == "NEW_USER")
{ {
buffer.clear(); buffer.clear();