summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/HTTPMessage.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-25 16:25:15 +0100
committerMattes D <github@xoft.cz>2015-01-27 14:53:32 +0100
commit6ec5e8caa77829d7ea3593b08f1f91244d027601 (patch)
treed5dafdb9e99e4648d0b257e34d23546a48e77bca /src/HTTPServer/HTTPMessage.cpp
parentRemoved ListenThread and SocketThreads. (diff)
downloadcuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.tar
cuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.tar.gz
cuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.tar.bz2
cuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.tar.lz
cuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.tar.xz
cuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.tar.zst
cuberite-6ec5e8caa77829d7ea3593b08f1f91244d027601.zip
Diffstat (limited to '')
-rw-r--r--src/HTTPServer/HTTPMessage.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/HTTPServer/HTTPMessage.cpp b/src/HTTPServer/HTTPMessage.cpp
index d59ca438e..c87b3cc8b 100644
--- a/src/HTTPServer/HTTPMessage.cpp
+++ b/src/HTTPServer/HTTPMessage.cpp
@@ -55,7 +55,10 @@ void cHTTPMessage::AddHeader(const AString & a_Key, const AString & a_Value)
}
else if (Key == "content-length")
{
- m_ContentLength = static_cast<size_t>(atol(m_Headers[Key].c_str()));
+ if (!StringToInteger(m_Headers[Key], m_ContentLength))
+ {
+ m_ContentLength = 0;
+ }
}
}