summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/MultipartParser.cpp
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/MultipartParser.cpp
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/MultipartParser.cpp')
-rw-r--r--src/HTTPServer/MultipartParser.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/HTTPServer/MultipartParser.cpp b/src/HTTPServer/MultipartParser.cpp
index 14c2c00fa..309495dd7 100644
--- a/src/HTTPServer/MultipartParser.cpp
+++ b/src/HTTPServer/MultipartParser.cpp
@@ -97,8 +97,6 @@ cMultipartParser::cMultipartParser(const AString & a_ContentType, cCallbacks & a
m_EnvelopeParser(*this),
m_HasHadData(false)
{
- static AString s_Multipart = "multipart/";
-
// Check that the content type is multipart:
AString ContentType(a_ContentType);
if (strncmp(ContentType.c_str(), "multipart/", 10) != 0)
@@ -146,7 +144,7 @@ cMultipartParser::cMultipartParser(const AString & a_ContentType, cCallbacks & a
-void cMultipartParser::Parse(const char * a_Data, int a_Size)
+void cMultipartParser::Parse(const char * a_Data, size_t a_Size)
{
// Skip parsing if invalid
if (!m_IsValid)
@@ -160,8 +158,8 @@ void cMultipartParser::Parse(const char * a_Data, int a_Size)
{
if (m_EnvelopeParser.IsInHeaders())
{
- int BytesConsumed = m_EnvelopeParser.Parse(m_IncomingData.data(), m_IncomingData.size());
- if (BytesConsumed < 0)
+ size_t BytesConsumed = m_EnvelopeParser.Parse(m_IncomingData.data(), m_IncomingData.size());
+ if (BytesConsumed == AString::npos)
{
m_IsValid = false;
return;