File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
src/aws-cpp-sdk-core/source/http/interceptor Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -22,21 +22,26 @@ class AwsChunkedIOStream : public Aws::IOStream {
2222
2323 protected:
2424 int_type underflow () override {
25- char buffer[8192 ];
26- size_t bytesRead = m_chunkStream.BufferedRead (buffer, sizeof (buffer));
25+ if (gptr () < egptr ()) {
26+ return traits_type::to_int_type (*gptr ());
27+ }
28+
29+ size_t bytesRead = m_chunkStream.BufferedRead (m_buffer, sizeof (m_buffer));
2730 if (bytesRead == 0 ) {
2831 return traits_type::eof ();
2932 }
3033
31- // Copy to internal buffer
32- m_buffer.assign (buffer, buffer + bytesRead);
33- setg (&m_buffer[0 ], &m_buffer[0 ], &m_buffer[0 ] + bytesRead);
34+ setg (m_buffer, m_buffer, m_buffer + bytesRead);
3435 return traits_type::to_int_type (*gptr ());
3536 }
3637
38+ std::streamsize showmanyc () override {
39+ return egptr () - gptr ();
40+ }
41+
3742 private:
3843 Aws::Utils::Stream::AwsChunkedStream<>& m_chunkStream;
39- std::vector< char > m_buffer;
44+ char m_buffer[ 8192 ] ;
4045 };
4146
4247 Aws::Utils::Stream::AwsChunkedStream<> m_chunkStream;
You can’t perform that action at this time.
0 commit comments