]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Use SBuf::size_type instead of int64_t on message segment sizes
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 1 Jun 2014 15:25:02 +0000 (08:25 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 1 Jun 2014 15:25:02 +0000 (08:25 -0700)
src/http/one/Parser.h
src/http/one/RequestParser.h

index 4a0f9be14e4ffc996eb2436d9d137cde5539459c..0c1ccc60c8dccbfd9fd81a2712de578554fb8907 100644 (file)
@@ -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_;}
index a0e3af4aa983622a3b68ecede85f9911f7b59000..8f6a51e40d83f26616b2e2a1949f90c8ffb79f09 100644 (file)
@@ -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