Parser& operator =(const Parser&); // do not implement
public:
+ typedef SBuf::size_type size_type;
+
Parser() { clear(); }
virtual ~Parser() {}
bool needsMoreData() const {return parsingStage_!=HTTP_PARSE_DONE;}
/// size in bytes of the first line including CRLF terminator
- virtual int64_t firstLineSize() const = 0;
+ virtual size_type firstLineSize() const = 0;
/// size in bytes of the message headers including CRLF terminator(s)
/// but excluding first-line bytes
- int64_t headerBlockSize() const {return mimeHeaderBlock_.length();}
+ size_type headerBlockSize() const {return mimeHeaderBlock_.length();}
/// size in bytes of HTTP message block, includes first-line and mime headers
/// excludes any body/entity/payload bytes
/// excludes any garbage prefix before the first-line
- int64_t messageHeaderSize() const {return firstLineSize() + headerBlockSize();}
+ size_type messageHeaderSize() const {return firstLineSize() + headerBlockSize();}
/// buffer containing HTTP mime headers, excluding message first-line.
SBuf mimeHeader() const {return mimeHeaderBlock_;}
RequestParser() : Parser() {clear();}
virtual ~RequestParser() {}
virtual void clear();
- virtual int64_t firstLineSize() const {return req.end - req.start + 1;}
+ virtual Http1::Parser::size_type firstLineSize() const {return req.end - req.start + 1;}
virtual bool parse(const SBuf &aBuf);
/// the HTTP method if this is a request message