MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / AuthenticateHandler

Method AuthenticateHandler

daemon/I2PControl.cpp:339–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337// handlers
338
339 void I2PControlService::AuthenticateHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
340 {
341 int api = params.get<int> ("API");
342 auto password = params.get<std::string> ("Password");
343 LogPrint (eLogDebug, "I2PControl: Authenticate API=", api, " Password=", password);
344 if (password != m_Password) {
345 LogPrint (eLogError, "I2PControl: Authenticate - Invalid password: ", password);
346 return;
347 }
348 InsertParam (results, "API", api);
349 results << ",";
350 std::string token = boost::lexical_cast<std::string>(i2p::util::GetSecondsSinceEpoch ());
351 m_Tokens.insert (token);
352 InsertParam (results, "Token", token);
353 }
354
355 void I2PControlService::EchoHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
356 {

Callers

nothing calls this directly

Calls 2

LogPrintFunction · 0.85
GetSecondsSinceEpochFunction · 0.85

Tested by

no test coverage detected