summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-05-30 20:26:14 +0000
committerSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-05-30 20:26:14 +0000
commit2bff302c8a8eb6768313df248b06e7f725a4ae87 (patch)
tree580511702ea74ed4a9e2689be804104746eb7caa /pages
parent1043c52409de2c44e5707177ee9dc1977126ca67 (diff)
downloadvdr-plugin-live-2bff302c8a8eb6768313df248b06e7f725a4ae87.tar.gz
vdr-plugin-live-2bff302c8a8eb6768313df248b06e7f725a4ae87.tar.bz2
- new files
Diffstat (limited to 'pages')
-rw-r--r--pages/content.ecpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/pages/content.ecpp b/pages/content.ecpp
new file mode 100644
index 0000000..cc604ba
--- /dev/null
+++ b/pages/content.ecpp
@@ -0,0 +1,34 @@
+<%pre>
+#include <string>
+#include <tnt/httpheader.h>
+#include "filecache.h"
+#include "setup.h"
+
+using namespace std;
+using namespace vdrlive;
+
+</%pre>
+<%args>
+string file;
+</%args>
+<%session scope="global">
+bool logged_in(false);
+</%session>
+<%cpp>
+//if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
+
+reply.setContentType("image/png");
+//reply.setContentType("text/plain");
+
+FileCache::ptr_type f = LiveFileCache().get("/tmp/live/" + file);
+if (f.get() == 0)
+ return HTTP_NOT_FOUND;
+
+string ctime = tnt::HttpMessage::htdate(f->ctime());
+string browserTime = request.getHeader(tnt::httpheader::ifModifiedSince);
+if (browserTime == ctime)
+ return HTTP_NOT_MODIFIED;
+
+reply.setHeader(tnt::httpheader::lastModified, ctime);
+reply.out().write(f->data(), f->size());
+</%cpp>