From: Amos Jeffries Date: Sun, 1 Jun 2014 15:25:02 +0000 (-0700) Subject: Use SBuf::size_type instead of int64_t on message segment sizes X-Git-Tag: merge-candidate-3-v1~506^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e677087a9e4111d71fd1319e6267becf7bfb20c;p=thirdparty%2Fsquid.git Use SBuf::size_type instead of int64_t on message segment sizes --- diff --git a/src/http/one/Parser.h b/src/http/one/Parser.h index 4a0f9be14e..0c1ccc60c8 100644 --- a/src/http/one/Parser.h +++ b/src/http/one/Parser.h @@ -30,6 +30,8 @@ class Parser : public RefCountable Parser& operator =(const Parser&); // do not implement public: + typedef SBuf::size_type size_type; + Parser() { clear(); } virtual ~Parser() {} @@ -49,16 +51,16 @@ public: 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_;} diff --git a/src/http/one/RequestParser.h b/src/http/one/RequestParser.h index a0e3af4aa9..8f6a51e40d 100644 --- a/src/http/one/RequestParser.h +++ b/src/http/one/RequestParser.h @@ -26,7 +26,7 @@ public: 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