aboutsummaryrefslogtreecommitdiff
path: root/zencore/httpserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/httpserver.cpp')
-rw-r--r--zencore/httpserver.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/zencore/httpserver.cpp b/zencore/httpserver.cpp
index 52389a11b..22cba4d75 100644
--- a/zencore/httpserver.cpp
+++ b/zencore/httpserver.cpp
@@ -1044,15 +1044,19 @@ public:
// Call http.sys API to receive the remaining data
+ static const uint64_t kMaxBytesPerApiCall = 1 * 1024 * 1024;
+
while (BytesToRead)
{
ULONG BytesRead = 0;
+ const uint64_t BytesToReadThisCall = zen::Min(BytesToRead, kMaxBytesPerApiCall);
+
ULONG ApiResult = HttpReceiveRequestEntityBody(m_HttpTx.RequestQueueHandle(),
HttpReq->RequestId,
0, /* Flags */
ReadPointer,
- (ULONG)BytesToRead,
+ gsl::narrow<ULONG>(BytesToReadThisCall),
&BytesRead,
NULL /* Overlapped */
);