Skip to content

Commit a1a6f9e

Browse files
committed
update to test changes
1 parent fcadbff commit a1a6f9e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/aws-cpp-sdk-core/source/http/interceptor/ChunkingInterceptor.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)