2019-01-10 Fred Gleason <fredg@paravelsystems.com>

* Refactored dropbox instance management to use multicast
	notifications.
This commit is contained in:
Fred Gleason
2019-01-10 18:11:18 -05:00
parent 5329189e89
commit 9e93dddb02
11 changed files with 90 additions and 23 deletions

View File

@@ -229,13 +229,18 @@ void MainObject::notificationReceivedData(const QString &msg,
const QHostAddress &addr)
{
RDNotification *notify=new RDNotification();
syslog(LOG_NOTICE,"recv: %s\n",(const char *)msg.toUtf8());
if(!notify->read(msg)) {
LogLine(RDConfig::LogWarning,
"Invalid notification received from "+addr.toString());
delete notify;
return;
}
RunLocalNotifications(notify);
BroadcastCommand("ON "+msg+"!");
delete notify;
}
@@ -512,6 +517,7 @@ bool MainObject::DispatchCommand(RipcdConnection *conn)
delete notify;
return true;
}
RunLocalNotifications(notify);
BroadcastCommand("ON "+msg+"!",conn->id());
ripcd_notification_mcaster->
send(msg,rda->system()->notificationAddress(),RD_NOTIFICATION_PORT);