char timestamp[100];
// TODO: make this configurable
- if (severity < LogInformation)
+ if (!IsDebugging() && severity < LogInformation)
return;
string severityStr;
void DelegationComponent::AssignServiceResponseHandler(Service& service, const Endpoint::Ptr& sender, bool timedOut)
{
/* ignore the message if it's not from the designated checker for this service */
- if (!sender || service.GetChecker() != sender->GetIdentity())
+ if (sender && service.GetChecker() != sender->GetIdentity())
return;
if (timedOut) {
for (map<string, Endpoint::Ptr>::iterator i = m_Endpoints.begin(); i != m_Endpoints.end(); i++)
{
Endpoint::Ptr endpoint = i->second;
+
+ /* don't forward messages between non-local endpoints */
+ if (!sender->IsLocal() && !endpoint->IsLocal())
+ continue;
+
if (endpoint->HasSubscription(method))
candidates.push_back(endpoint);
}
void JsonRpcEndpoint::ProcessRequest(Endpoint::Ptr sender, const RequestMessage& message)
{
if (IsConnected()) {
- string id;
- if (message.GetID(&id))
- // TODO: remove calls after a certain timeout (and notify callers?)
- m_PendingCalls[id] = sender;
-
m_Client->SendMessage(message);
} else {
// TODO: persist the event
{
Application::Log(LogWarning, "jsonrpc", "Lost connection to endpoint: identity=" + GetIdentity());
- m_PendingCalls.clear();
-
// TODO: _only_ clear non-persistent publications/subscriptions
// unregister ourselves if no persistent publications/subscriptions are left (use a timer for that, once we have a TTL property for the topics)
ClearSubscriptions();
shared_ptr<SSL_CTX> m_SSLContext;
string m_Address;
JsonRpcClient::Ptr m_Client;
- map<string, Endpoint::Ptr> m_PendingCalls;
void SetAddress(string address);