File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
src/aws-cpp-sdk-core/include/smithy/client/features Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -38,19 +38,20 @@ class AwsChunkedStreamBuf : public std::streambuf {
3838 if (gptr () < egptr ()) {
3939 return traits_type::to_int_type (*gptr ());
4040 }
41-
42- if (m_stream->good ()) {
43- m_stream->read (m_data.GetUnderlyingData (), m_bufferSize);
44- size_t bytesRead = static_cast <size_t >(m_stream->gcount ());
45- writeChunk (bytesRead);
46-
47- if ((m_stream->peek () == EOF || m_stream->eof ()) && !m_stream->bad ()) {
48- writeTrailerToUnderlyingStream ();
49- }
50- }
5141
42+ // Only read from source stream if chunking stream is empty
5243 if ((m_chunkingStream->peek () == EOF || m_chunkingStream->eof ()) && !m_chunkingStream->bad ()) {
53- return traits_type::eof ();
44+ if (m_stream->good ()) {
45+ m_stream->read (m_data.GetUnderlyingData (), m_bufferSize);
46+ size_t bytesRead = static_cast <size_t >(m_stream->gcount ());
47+ writeChunk (bytesRead);
48+
49+ if ((m_stream->peek () == EOF || m_stream->eof ()) && !m_stream->bad ()) {
50+ writeTrailerToUnderlyingStream ();
51+ }
52+ } else {
53+ return traits_type::eof ();
54+ }
5455 }
5556
5657 m_chunkingStream->read (m_buffer, sizeof (m_buffer));
You can’t perform that action at this time.
0 commit comments