summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/MultipartParser.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-04-27 15:35:27 +0200
committerTycho <work.tycho+git@gmail.com>2014-04-27 15:35:27 +0200
commit57b8ee9163181920b634e475c781fe7764e11b98 (patch)
tree7d0675f8cda49a39b0b42eaaa928cfb66b57869a /src/HTTPServer/MultipartParser.cpp
parentImplemented Chunk Sparsing with segments (diff)
parentMerge pull request #863 from mc-server/chunkysparsing (diff)
downloadcuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar
cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.gz
cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.bz2
cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.lz
cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.xz
cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.zst
cuberite-57b8ee9163181920b634e475c781fe7764e11b98.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;