diff options
author | thlo <t.lohmar@gmx.de> | 2013-05-10 13:19:35 +0200 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-05-10 13:19:35 +0200 |
commit | 9674b225dd0fddc5d2fe0c11c108c5167607523d (patch) | |
tree | 8ca5f0206343e288eeb4c8e598b537181ab4c225 /httpresource.c | |
parent | b08431d6b45acada11104c775d3fb56e907dfa5e (diff) | |
download | vdr-plugin-smarttvweb-9674b225dd0fddc5d2fe0c11c108c5167607523d.tar.gz vdr-plugin-smarttvweb-9674b225dd0fddc5d2fe0c11c108c5167607523d.tar.bz2 |
New Methods timer.xml and deleterTimer.xml. timestamp added to vdrstatus.xml. HTTP Error responses are numbered (prep for multi-language).
Diffstat (limited to 'httpresource.c')
-rwxr-xr-x | httpresource.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/httpresource.c b/httpresource.c index f718816..08a3e08 100755 --- a/httpresource.c +++ b/httpresource.c @@ -309,6 +309,12 @@ int cHttpResource::processRequest() { return OKAY; } + if (mPath.compare("/timers.xml") == 0) { + mResponse = new cResponseMemBlk(this); + ((cResponseMemBlk*)mResponse)->sendTimersXml(); + return OKAY; + } + if (mPath.compare("/setResume.xml") == 0) { mResponse = new cResponseMemBlk(this); ((cResponseMemBlk*)mResponse)->receiveResume(); @@ -327,6 +333,19 @@ int cHttpResource::processRequest() { return OKAY; } + //thlo for testing purpose + if (mPath.compare("/deleteTimer.xml") == 0) { + mResponse = new cResponseMemBlk(this); + ((cResponseMemBlk*)mResponse)->receiveDelTimerReq(); + return OKAY; + } + + //thlo for testing purpose + if (mPath.compare("/addTimer.xml") == 0) { + mResponse = new cResponseMemBlk(this); + ((cResponseMemBlk*)mResponse)->receiveAddTimerReq(); + return OKAY; + } #endif if (mPath.compare("/yt-bookmarklet.js") == 0) { @@ -357,7 +376,7 @@ int cHttpResource::processRequest() { mPath = mFactory->getConfigDir() + "/widget.conf"; if (stat(mPath.c_str(), &statbuf) < 0) { - mResponse = new cResponseError(this, 404, "Not Found", NULL, "File not found."); + mResponse = new cResponseError(this, 404, "Not Found", NULL, "003 File not found."); // ((cResponseError*)mResponse)->sendError(404, "Not Found", NULL, "File not found."); return OKAY; } @@ -373,7 +392,7 @@ int cHttpResource::processRequest() { mPath = mFactory->getConfigDir() + "/web/favicon.ico"; if (stat(mPath.c_str(), &statbuf) < 0) { - mResponse = new cResponseError(this, 404, "Not Found", NULL, "File not found."); + mResponse = new cResponseError(this, 404, "Not Found", NULL, "003 File not found."); // ((cResponseError*)mResponse)->sendError(404, "Not Found", NULL, "File not found."); return OKAY; } @@ -427,7 +446,7 @@ int cHttpResource::processRequest() { // checking, whether the file or directory exists *(mLog->log())<< DEBUGPREFIX << " File Not found " << mPath << endl; - mResponse = new cResponseError(this, 404, "Not Found", NULL, "File not found."); + mResponse = new cResponseError(this, 404, "Not Found", NULL, "003 File not found."); // ((cResponseError*)mResponse)->sendError(404, "Not Found", NULL, "File not found."); return OKAY; @@ -453,7 +472,7 @@ int cHttpResource::processRequest() { if (!((ok_to_serve) or (mPath.compare(0, (mFactory->getConfig()->getMediaFolder()).size(), mFactory->getConfig()->getMediaFolder()) == 0))) { // No directory access outside of MediaFolder (and also VDRCONG/web) - mResponse = new cResponseError(this, 404, "Not Found", NULL, "File not found."); + mResponse = new cResponseError(this, 404, "Not Found", NULL, "003 File not found."); // ((cResponseError*)mResponse)->sendError(404, "Not Found", NULL, "File not found."); return OKAY; } @@ -482,7 +501,7 @@ int cHttpResource::processRequest() { // Check, if requested file is in Media Directory if (!((ok_to_serve) or (mPath.compare(0, (mFactory->getConfig()->getMediaFolder()).size(), mFactory->getConfig()->getMediaFolder()) == 0))) { - mResponse = new cResponseError(this, 404, "Not Found", NULL, "File not found."); + mResponse = new cResponseError(this, 404, "Not Found", NULL, "003 File not found."); // ((cResponseError*)mResponse)->sendError(404, "Not Found", NULL, "File not found."); return OKAY; } @@ -588,12 +607,24 @@ int cHttpResource::handlePost() { } if (mPath.compare("/deleteRecording.xml") == 0) { - mResponse = new cResponseMemBlk(this); ((cResponseMemBlk*)mResponse)->receiveDelRecReq(); return OKAY; } + if (mPath.compare("/deleteTimer.xml") == 0) { + mResponse = new cResponseMemBlk(this); + ((cResponseMemBlk*)mResponse)->receiveDelTimerReq(); + return OKAY; + } + + if (mPath.compare("/addTimer.xml") == 0) { + mResponse = new cResponseMemBlk(this); + ((cResponseMemBlk*)mResponse)->receiveAddTimerReq(); + return OKAY; + } + + // Should not reach the end of the function return ERROR; } |