From cdc089b41563a216f9a1a9dfa27ba486d1484990 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 23 Apr 2007 15:00:49 +0000 Subject: First steps towards a new HTTP backend. --- include/HttpServ.h | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'include') 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 #include #include -#include #include +#include +#include #include +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 + #endif -- cgit v1.2.3