fix notchunked mode in ReadBufferFromPocoSocketChunked

This commit is contained in:
Yakov Olkhovskiy 2024-05-24 03:36:29 +00:00
parent 94bc0a1e96
commit 147ad42df0
2 changed files with 8 additions and 1 deletions

View File

@ -44,6 +44,13 @@ void ReadBufferFromPocoSocketChunked::setAsyncCallback(AsyncCallback async_callb
buffer_socket.setAsyncCallback(async_callback_);
}
bool ReadBufferFromPocoSocketChunked::hasBufferedData() const
{
if (chunked)
return hasPendingData() || buffer_socket.hasPendingData();
return hasPendingData();
}
bool ReadBufferFromPocoSocketChunked::startChunk()
{
if (buffer_socket.read(reinterpret_cast<char *>(&chunk_left), sizeof(chunk_left)) < sizeof(chunk_left))

View File

@ -16,7 +16,7 @@ public:
bool poll(size_t timeout_microseconds);
void setAsyncCallback(AsyncCallback async_callback_);
bool hasBufferedData() const { return hasPendingData() || buffer_socket.hasPendingData(); }
bool hasBufferedData() const;
Poco::Net::SocketAddress peerAddress() { return peer_address; }
Poco::Net::SocketAddress ourAddress() { return our_address; }