summaryrefslogtreecommitdiff
path: root/smarttvweb.c
diff options
context:
space:
mode:
Diffstat (limited to 'smarttvweb.c')
-rw-r--r--smarttvweb.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/smarttvweb.c b/smarttvweb.c
index b85dddc..60827e4 100644
--- a/smarttvweb.c
+++ b/smarttvweb.c
@@ -60,6 +60,10 @@ public:
virtual bool Initialize(void);
virtual bool Start(void);
virtual bool SetupParse(const char *Name, const char *Value);
+
+ virtual const char **SVDRPHelpPages(void);
+ virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
+
#if VDRVERSNUM > 10300
virtual cString Active(void);
#endif
@@ -125,6 +129,35 @@ bool cPluginSmartTvWeb::SetupParse(const char *Name, const char *Value)
return false;
}
+const char **cPluginSmartTvWeb::SVDRPHelpPages(void) {
+ static const char *HelpPages[] = {
+ "SESSIONS\n"
+ " Print the number of active sessions.",
+ NULL
+ };
+ return HelpPages;
+}
+
+cString cPluginSmartTvWeb::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) {
+ if (strcasecmp(Command, "SESSIONS") == 0) {
+ return cString::sprintf("%d Active HTTP Sessions", mServer.getActiveHttpSessions());
+ }
+ else if (strcasecmp(Command, "TIME") == 0) {
+ ReplyCode = 901;
+ if (*Option) {
+ if (strcasecmp(Option, "RAW") == 0)
+ return cString::sprintf("%ld\nThis is the number of seconds since the epoch\nand a demo of a multi-line reply", time(NULL));
+ else {
+ ReplyCode = 504;
+ return cString::sprintf("Unknown option: \"%s\"", Option);
+ }
+ }
+ return TimeString(time(NULL));
+ }
+ return NULL;
+}
+
+
#if VDRVERSNUM > 10300
cString cPluginSmartTvWeb::Active(void) {