Skip to content

Commit 7ecf721

Browse files
committed
Adding a few necessary static_casts since our streams API doesn't work with uint64_t.
1 parent ffa8ffa commit 7ecf721

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Release/src/http/client/http_linux.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ namespace web { namespace http
699699
}
700700
};
701701

702-
const size_t readSize = std::min(client_config().chunksize(), ctx->m_known_size - ctx->m_uploaded);
702+
const auto readSize = static_cast<size_t>(std::min(static_cast<uint64_t>(client_config().chunksize()), ctx->m_known_size - ctx->m_uploaded));
703703

704704
auto readbuf = ctx->_get_readbuffer();
705705
readbuf.getn(boost::asio::buffer_cast<uint8_t *>(ctx->m_body_buf.prepare(readSize)), readSize)
@@ -892,7 +892,7 @@ namespace web { namespace http
892892
{
893893
if (!needChunked)
894894
{
895-
async_read_until_buffersize(std::min(ctx->m_known_size, client_config().chunksize()),
895+
async_read_until_buffersize(static_cast<size_t>(std::min(ctx->m_known_size, static_cast<uint64_t>(client_config().chunksize()))),
896896
boost::bind(&linux_client::handle_read_content, shared_from_this(), boost::asio::placeholders::error, ctx), ctx);
897897
}
898898
else
@@ -1069,7 +1069,7 @@ namespace web { namespace http
10691069

10701070
// more data need to be read
10711071
writeBuffer.putn(boost::asio::buffer_cast<const uint8_t *>(ctx->m_body_buf.data()),
1072-
std::min(ctx->m_body_buf.size(), ctx->m_known_size - ctx->m_downloaded))
1072+
static_cast<size_t>(std::min(static_cast<uint64_t>(ctx->m_body_buf.size()), ctx->m_known_size - ctx->m_downloaded)))
10731073
.then([=](pplx::task<size_t> op)
10741074
{
10751075
size_t writtenSize = 0;
@@ -1079,7 +1079,7 @@ namespace web { namespace http
10791079
ctx->m_downloaded += static_cast<uint64_t>(writtenSize);
10801080
ctx->m_body_buf.consume(writtenSize);
10811081

1082-
async_read_until_buffersize(std::min(client_config().chunksize(), ctx->m_known_size - ctx->m_downloaded),
1082+
async_read_until_buffersize(static_cast<size_t>(std::min(static_cast<uint64_t>(client_config().chunksize()), ctx->m_known_size - ctx->m_downloaded)),
10831083
boost::bind(&linux_client::handle_read_content, shared_from_this(), boost::asio::placeholders::error, ctx), ctx);
10841084
}
10851085
catch (...)

0 commit comments

Comments
 (0)