aboutsummaryrefslogtreecommitdiff
path: root/lib/network/http_file.h
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2003-10-17 15:36:42 +0000
committerFelix Domke <tmbinc@elitedvb.net>2003-10-17 15:36:42 +0000
commitd63d2c3c6cbbd574dda4f8b00ebe6c661735edd5 (patch)
tree84d0cacfd0b6c1241c236c7860f7cbd7f26901bb /lib/network/http_file.h
downloadenigma2-d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5.tar.gz
enigma2-d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5.zip
import of enigma2
Diffstat (limited to 'lib/network/http_file.h')
-rw-r--r--lib/network/http_file.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/network/http_file.h b/lib/network/http_file.h
new file mode 100644
index 00000000..88bffc60
--- /dev/null
+++ b/lib/network/http_file.h
@@ -0,0 +1,37 @@
+#ifndef __http_file_h
+#define __http_file_h
+
+#include "httpd.h"
+
+class eHTTPFile: public eHTTPDataSource
+{
+ int fd, size;
+ const char *mime;
+ int method;
+public:
+ enum { methodGET, methodPUT };
+ eHTTPFile(eHTTPConnection *c, int fd, int method, const char *mime);
+ ~eHTTPFile();
+ int doWrite(int);
+ void haveData(void *data, int len);
+};
+
+class eHTTPFilePathResolver: public eHTTPPathResolver
+{
+ struct eHTTPFilePath
+ {
+ eString path;
+ eString root;
+ int authorized; // must be authorized (1 means read, 2 write)
+ eHTTPFilePath(eString path, eString root, int authorized): path(path), root(root), authorized(authorized)
+ {
+ }
+ };
+ ePtrList<eHTTPFilePath> translate;
+public:
+ eHTTPFilePathResolver();
+ eHTTPDataSource *getDataSource(eString request, eString path, eHTTPConnection *conn);
+ void addTranslation(eString path, eString root, int auth);
+};
+
+#endif