summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/HTTPMessage.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-30 08:40:45 +0100
committerMattes D <github@xoft.cz>2015-01-30 08:40:45 +0100
commitfd49e34e331fc716c48ea1228f24954e9b8b5304 (patch)
tree8d19b61fb5b3052b870ccc9ac956c5069d12dc74 /src/HTTPServer/HTTPMessage.cpp
parentUpdated PolarSSL. (diff)
parentFixed listening ports not closed on cServerHandle::Close. (diff)
downloadcuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.gz
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.bz2
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.lz
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.xz
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.zst
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.zip
Diffstat (limited to 'src/HTTPServer/HTTPMessage.cpp')
-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;
+ }
}
}