File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -665,14 +665,19 @@ namespace web { namespace http
665
665
};
666
666
667
667
const auto readSize = static_cast <size_t >(std::min (static_cast <uint64_t >(client_config ().chunksize ()), ctx->m_known_size - ctx->m_uploaded ));
668
-
669
668
auto readbuf = ctx->_get_readbuffer ();
670
669
readbuf.getn (boost::asio::buffer_cast<uint8_t *>(ctx->m_body_buf .prepare (readSize)), readSize)
671
670
.then ([=](pplx::task<size_t > op)
672
671
{
673
672
try
674
673
{
675
- write_chunk (op.get ());
674
+ const auto actualReadSize = op.get ();
675
+ if (actualReadSize == 0 )
676
+ {
677
+ ctx->report_exception (http_exception (" Unexpected end of request body stream encountered before Content-Length satisfied." ));
678
+ return ;
679
+ }
680
+ write_chunk (actualReadSize);
676
681
}
677
682
catch (...)
678
683
{
You can’t perform that action at this time.
0 commit comments