|
@ -1,4 +1,5 @@ |
|
|
#include "PityTransport.hh" |
|
|
#include "PityTransport.hh" |
|
|
|
|
|
#include "PityUnit.hh" |
|
|
#include "iostream" |
|
|
#include "iostream" |
|
|
#include "../../../src/std_utils.hh" |
|
|
#include "../../../src/std_utils.hh" |
|
|
#include <random> |
|
|
#include <random> |
|
@ -6,6 +7,7 @@ |
|
|
#include <memory> |
|
|
#include <memory> |
|
|
#include <unordered_map> |
|
|
#include <unordered_map> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace pEp { |
|
|
namespace pEp { |
|
|
namespace PityTest11 { |
|
|
namespace PityTest11 { |
|
|
bool PityTransport::debug_log_enabled = false; |
|
|
bool PityTransport::debug_log_enabled = false; |
|
@ -18,12 +20,16 @@ namespace pEp { |
|
|
void PityTransport::sendMsg(const std::string nodename, const std::string& msg) const |
|
|
void PityTransport::sendMsg(const std::string nodename, const std::string& msg) const |
|
|
{ |
|
|
{ |
|
|
pEpLogClass("Address: " + nodename + " msg: " + msg); |
|
|
pEpLogClass("Address: " + nodename + " msg: " + msg); |
|
|
|
|
|
|
|
|
|
|
|
// HACK TODO
|
|
|
|
|
|
std::string nodename_normalize = PityUnit<>::_normalizeName(nodename); |
|
|
|
|
|
|
|
|
bool found = false; |
|
|
bool found = false; |
|
|
std::string dir; |
|
|
std::string dir; |
|
|
try { |
|
|
try { |
|
|
dir = _endpoints.at(nodename); |
|
|
dir = _endpoints.at(nodename_normalize); |
|
|
} catch (std::out_of_range&) { |
|
|
} catch (std::out_of_range&) { |
|
|
throw std::runtime_error("no such nodename: " + nodename); |
|
|
throw std::runtime_error("no such nodename: " + nodename_normalize); |
|
|
} |
|
|
} |
|
|
Utils::dir_ensure(dir); |
|
|
Utils::dir_ensure(dir); |
|
|
std::stringstream filename; |
|
|
std::stringstream filename; |
|
|