From 5beab710a38f4e1fa983c9db650ed467cc467e0b Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 14 Jan 2011 20:02:24 +0000 Subject: [PATCH] *Web: HttpClient fixed max_content_size issue git-svn-id: svn://ultimatepp.org/upp/trunk@2999 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Web/httpcli.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uppsrc/Web/httpcli.cpp b/uppsrc/Web/httpcli.cpp index 7f90cca7b..0d052fa5a 100644 --- a/uppsrc/Web/httpcli.cpp +++ b/uppsrc/Web/httpcli.cpp @@ -379,7 +379,7 @@ String HttpClient::Execute(Gate2 progress) for(p += CL_LENGTH; *p == ' '; p++) ; if(IsDigit(*p)) { - content_length = minmax(stou(p), 0, max_content_size); + content_length = stou(p); if(content_length > max_content_size) { error = NFormat(t_("%s:%d: maximum data length exceeded (%d B)"), host, port, max_content_size); return String::GetVoid(); @@ -432,7 +432,7 @@ String HttpClient::Execute(Gate2 progress) } String part = socket.Read(1000); if(!part.IsEmpty()) { - if(body.GetLength() + part.GetLength() > DEFAULT_MAX_CONTENT_SIZE) { + if(body.GetLength() + part.GetLength() > max_content_size) { error = NFormat(t_("Maximum content size exceeded: %d"), body.GetLength() + part.GetLength()); goto EXIT; }