| 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 | { |
nothing calls this directly
no test coverage detected