summaryrefslogtreecommitdiff
path: root/include/HttpServ.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/HttpServ.h')
-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