summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorpixel <pixel>2007-04-23 15:00:49 +0000
committerpixel <pixel>2007-04-23 15:00:49 +0000
commitcdc089b41563a216f9a1a9dfa27ba486d1484990 (patch)
tree723e8989383086b76a5a53f7220f1648801e9533 /include
parent6ee340fa32c42dfaa69604e67f9848c918675af7 (diff)
First steps towards a new HTTP backend.
Diffstat (limited to 'include')
-rw-r--r--include/HttpServ.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/include/HttpServ.h b/include/HttpServ.h
index fc58246..db454e0 100644
--- a/include/HttpServ.h
+++ b/include/HttpServ.h
@@ -4,15 +4,16 @@
#include <Socket.h>
#include <BString.h>
#include <Variables.h>
-#include <Action.h>
#include <Task.h>
+#include <Buffer.h>
+#include <Handle.h>
#include <Exceptions.h>
+class Action;
class HttpServ : public Task {
public:
- HttpServ(Action *, int = 1500, const String & = String("GruiK Server v0.1")) throw (GeneralException);
+ HttpServ(Action *, int = 1500, const String & = String("GruiK Server v0.2")) throw (GeneralException);
virtual ~HttpServ();
- void SetMenu(Action *);
virtual String GetName();
protected:
@@ -25,6 +26,37 @@ class HttpServ : public Task {
int localport;
};
+class HttpResponse : public Base {
+ public:
+ typedef enum {
+ HTTP_200_OK = 200,
+ HTTP_301_PERM_MOVED = 301,
+ HTTP_302_FOUND = 302,
+ HTTP_400_BAD_REQUEST = 400,
+ HTTP_401_UNAUTHORIZED = 401,
+ HTTP_403_FORBIDDEN = 403,
+ HTTP_404_NOT_FOUND = 404,
+ HTTP_500_INTERNAL_ERROR = 500,
+ HTTP_503_SERVICE_UNAVAILABLE = 503,
+ } return_code_t;
+ HttpResponse();
+ virtual ~HttpResponse();
+ Task * BuildResponse(Handle * out);
+
+ String mime_type;
+ String location;
+ String server_name;
+ return_code_t return_code;
+ time_t last_modified;
+ Buffer contents;
+ bool cache;
+
+ public:
+ String code_to_string();
+};
+
extern String endhl, endnl;
+#include <Action.h>
+
#endif