/* */ #ifndef _D_HTTP_HEADER_PROCESSOR_H_ #define _D_HTTP_HEADER_PROCESSOR_H_ #include "common.h" #include "HttpHeader.h" #include #include class HttpHeaderProcessor { private: stringstream strm; int32_t _limit; void checkHeaderLimit(int32_t incomingLength); public: HttpHeaderProcessor():_limit(4096) {} ~HttpHeaderProcessor() {} void update(const char* data, int32_t length); void update(const string& data); /** * Returns true if end of header is reached. */ bool eoh() const; /** * Retruns the number of bytes beyond the end of header. */ int32_t getPutBackDataLength() const; pair getHttpStatusHeader(); string getHeaderString() const; void clear(); void setHeaderLimit(int32_t limit) { _limit = limit; } }; typedef SharedHandle HttpHeaderProcessorHandle; #endif // _D_HTTP_HEADER_PROCESSOR_H_