summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-04 12:05:56 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-04 12:05:56 +0100
commit4bdc69eb92dd149a519cb44939cc0f8868c3ecd8 (patch)
tree4fb59dd445a75bf65867caeef17f54167f64297a /svdrp.c
parentf35e4acf887a7fa065d0c2addc0a33a3885b1ae0 (diff)
downloadvdr-4bdc69eb92dd149a519cb44939cc0f8868c3ecd8.tar.gz
vdr-4bdc69eb92dd149a519cb44939cc0f8868c3ecd8.tar.bz2
Fixed a possible race condition with the SVDRP commands CLRE and PUTE
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/svdrp.c b/svdrp.c
index 613a019f..01366ddf 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 2.15 2012/02/16 12:38:19 kls Exp $
+ * $Id: svdrp.c 2.16 2012/03/04 12:05:56 kls Exp $
*/
#include "svdrp.h"
@@ -601,9 +601,13 @@ void cSVDRP::CmdCLRE(const char *Option)
Reply(501, "Undefined channel \"%s\"", Option);
}
else {
- cSchedules::ClearAll();
cEitFilter::SetDisableUntil(time(NULL) + EITDISABLETIME);
- Reply(250, "EPG data cleared");
+ if (cSchedules::ClearAll()) {
+ Reply(250, "EPG data cleared");
+ cEitFilter::SetDisableUntil(time(NULL) + EITDISABLETIME);
+ }
+ else
+ Reply(451, "Error while clearing EPG data");
}
}
@@ -1600,6 +1604,7 @@ void cSVDRP::Execute(char *Cmd)
Reply(PUTEhandler->Status(), "%s", PUTEhandler->Message());
DELETENULL(PUTEhandler);
}
+ cEitFilter::SetDisableUntil(time(NULL) + EITDISABLETIME); // re-trigger the timeout, in case there is very much EPG data
return;
}
// skip leading whitespace: