diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2003-10-17 15:35:43 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2003-10-17 15:35:43 +0000 |
| commit | fc2f5b2cd655f1391f2abda1b39e37cdec98a951 (patch) | |
| tree | 312efcea86a319de407a7c314fb981fb1c71019a /lib/network/http_file.h | |
| download | enigma2-fc2f5b2cd655f1391f2abda1b39e37cdec98a951.tar.gz enigma2-fc2f5b2cd655f1391f2abda1b39e37cdec98a951.zip | |
Initial revision
Diffstat (limited to 'lib/network/http_file.h')
| -rw-r--r-- | lib/network/http_file.h | 37 |
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 |
