Skip to content

Commit dbd74ad

Browse files
Push Tcp content even when the source is not ready yet.
1 parent cb67514 commit dbd74ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sming/Components/Network/src/Network/TcpConnection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ int TcpConnection::write(IDataSourceStream* stream)
247247
char buffer[NETWORK_SEND_BUFFER_SIZE];
248248
auto bytesRead = stream->readMemoryBlock(buffer, std::min(sizeof(buffer), available));
249249
if(bytesRead == 0) {
250+
if(pushCount == 0 && stream->available() != 0) {
251+
pushCount = 1; // the stream has data but it is not ready yet, wait for next poll to try again
252+
}
250253
break;
251254
}
252255

0 commit comments

Comments
 (0)