comparison OrthancFramework/Sources/HttpServer/HttpServer.cpp @ 4152:36257d6f348f

Support of multipart messages larger than 2GB in the embedded HTTP server
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Aug 2020 15:22:03 +0200
parents bf7b9edf6b81
children 9ce5c89328f5
comparison
equal deleted inserted replaced
4151:8c559dd5034b 4152:36257d6f348f
295 295
296 static PostDataStatus ReadBodyWithContentLength(std::string& body, 296 static PostDataStatus ReadBodyWithContentLength(std::string& body,
297 struct mg_connection *connection, 297 struct mg_connection *connection,
298 const std::string& contentLength) 298 const std::string& contentLength)
299 { 299 {
300 int length; 300 size_t length;
301 try 301 try
302 { 302 {
303 length = boost::lexical_cast<int>(contentLength); 303 length = boost::lexical_cast<size_t>(contentLength);
304 } 304 }
305 catch (boost::bad_lexical_cast&) 305 catch (boost::bad_lexical_cast&)
306 { 306 {
307 return PostDataStatus_NoLength; 307 return PostDataStatus_NoLength;
308 } 308 }
321 if (r <= 0) 321 if (r <= 0)
322 { 322 {
323 return PostDataStatus_Failure; 323 return PostDataStatus_Failure;
324 } 324 }
325 325
326 assert(r <= length); 326 assert(static_cast<size_t>(r) <= length);
327 length -= r; 327 length -= r;
328 pos += r; 328 pos += r;
329 } 329 }
330 330
331 return PostDataStatus_Success; 331 return PostDataStatus_Success;