summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/HTTPMessage.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-01 16:36:00 +0200
committermadmaxoft <github@xoft.cz>2014-04-01 16:36:00 +0200
commit1795cca5522476006d33d0c276e27a50659c867a (patch)
treec4abcc1ac701bbaf092a729a093058601aae1e79 /src/HTTPServer/HTTPMessage.h
parentRemoved the exit-time-destructors flag from clang. (diff)
downloadcuberite-1795cca5522476006d33d0c276e27a50659c867a.tar
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.gz
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.bz2
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.lz
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.xz
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.zst
cuberite-1795cca5522476006d33d0c276e27a50659c867a.zip
Diffstat (limited to 'src/HTTPServer/HTTPMessage.h')
-rw-r--r--src/HTTPServer/HTTPMessage.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/HTTPServer/HTTPMessage.h b/src/HTTPServer/HTTPMessage.h
index ab3338db7..d4d96f7cb 100644
--- a/src/HTTPServer/HTTPMessage.h
+++ b/src/HTTPServer/HTTPMessage.h
@@ -42,7 +42,7 @@ public:
void SetContentLength(int a_ContentLength) { m_ContentLength = a_ContentLength; }
const AString & GetContentType (void) const { return m_ContentType; }
- int GetContentLength(void) const { return m_ContentLength; }
+ size_t GetContentLength(void) const { return m_ContentLength; }
protected:
typedef std::map<AString, AString> cNameValueMap;
@@ -54,8 +54,10 @@ protected:
/** Type of the content; parsed by AddHeader(), set directly by SetContentLength() */
AString m_ContentType;
- /** Length of the content that is to be received. -1 when the object is created, parsed by AddHeader() or set directly by SetContentLength() */
- int m_ContentLength;
+ /** Length of the content that is to be received.
+ AString::npos when the object is created.
+ Parsed by AddHeader() or set directly by SetContentLength() */
+ size_t m_ContentLength;
} ;
@@ -72,9 +74,9 @@ public:
cHTTPRequest(void);
/** Parses the request line and then headers from the received data.
- Returns the number of bytes consumed or a negative number for error
+ Returns the number of bytes consumed or AString::npos number for error
*/
- int ParseHeaders(const char * a_Data, int a_Size);
+ size_t ParseHeaders(const char * a_Data, size_t a_Size);
/** Returns true if the request did contain a Content-Length header */
bool HasReceivedContentLength(void) const { return (m_ContentLength >= 0); }
@@ -145,7 +147,7 @@ protected:
/** Parses the incoming data for the first line (RequestLine)
Returns the number of bytes consumed, or -1 for an error
*/
- int ParseRequestLine(const char * a_Data, int a_Size);
+ size_t ParseRequestLine(const char * a_Data, size_t a_Size);
// cEnvelopeParser::cCallbacks overrides:
virtual void OnHeaderLine(const AString & a_Key, const AString & a_Value) override;