diff 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
line wrap: on
line diff
--- a/OrthancFramework/Sources/HttpServer/HttpServer.cpp	Wed Aug 19 11:59:02 2020 +0200
+++ b/OrthancFramework/Sources/HttpServer/HttpServer.cpp	Wed Aug 19 15:22:03 2020 +0200
@@ -297,10 +297,10 @@
                                                   struct mg_connection *connection,
                                                   const std::string& contentLength)
   {
-    int length;
+    size_t length;
     try
     {
-      length = boost::lexical_cast<int>(contentLength);
+      length = boost::lexical_cast<size_t>(contentLength);
     }
     catch (boost::bad_lexical_cast&)
     {
@@ -323,7 +323,7 @@
         return PostDataStatus_Failure;
       }
 
-      assert(r <= length);
+      assert(static_cast<size_t>(r) <= length);
       length -= r;
       pos += r;
     }