#ifndef __HTTPSERV_H__ #define __HTTPSERV_H__ #include #include #include #include #include #include #include class Action; class HttpServ : public Task { public: HttpServ(Action *, int = 1500, const String & = String("GruiK Server v0.2")) throw (GeneralException); virtual ~HttpServ(); virtual String GetName(); protected: virtual int Do() throw (GeneralException); private: Socket Listener; Action * p; String name; 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