2019-12-09 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdcatchd(8) that failed to send a MODIFY
	notification at the end of a Record or Download event.
This commit is contained in:
Fred Gleason
2019-12-09 03:01:03 -05:00
parent 525573a245
commit c7efd9245c
4 changed files with 42 additions and 1 deletions

View File

@@ -66,16 +66,28 @@ void MainObject::catchConnectedData(int serial,bool state)
exit(256);
}
connect(rda,SIGNAL(userChanged()),this,SLOT(userChangedData()));
rda->ripc()->
connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
}
void MainObject::userChangedData()
{
//
// Dispatch Handler
//
switch(batch_event->type()) {
case RDRecording::Recording:
RunImport(batch_event);
SendNotification(RDNotification::CartType,RDNotification::ModifyAction,
RDCut::cartNumber(batch_event->cutName()));
break;
case RDRecording::Download:
RunDownload(batch_event);
SendNotification(RDNotification::CartType,RDNotification::ModifyAction,
RDCut::cartNumber(batch_event->cutName()));
break;
case RDRecording::Upload:
@@ -87,6 +99,15 @@ void MainObject::catchConnectedData(int serial,bool state)
exit(256);
}
QTimer *timer=new QTimer(this);
timer->setSingleShot(true);
connect(timer,SIGNAL(timeout()),this,SLOT(exitData()));
timer->start(5000); // So notifications have a chance to propagate
}
void MainObject::exitData()
{
exit(0);
}
@@ -95,7 +116,6 @@ void MainObject::RunBatch(RDCmdSwitch *cmd)
{
bool ok=false;
int id=-1;
// unsigned schema=0;
//
// Set Process Priority
@@ -240,6 +260,7 @@ void MainObject::RunDownload(CatchEvent *evt)
catch_connect->setExitCode(evt->id(),RDRecording::Ok,"OK");
}
void MainObject::RunUpload(CatchEvent *evt)
{
RDUpload::ErrorCode conv_err;