Skip to content

Commit

Permalink
write buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Aug 9, 2024
1 parent 8c3c5df commit c8c3697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EthernetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,14 @@ void EthernetInterface::loop2() {
DIAG(F("Ethernet outboundRing socket=%d error"), socketOut);
} else if (socketOut >= 0) {
int count=outboundRing->count();
if (Diag::ETHERNET) DIAG(F("Ethernet reply socket=%d, count=:%d"), socketOut,count);
{
char tmpbuf[count+1]; // one extra for '\0'
for(int i=0;i<count;i++) {
tmpbuf[i] = outboundRing->read();
}
tmpbuf[count]=0;
if (Diag::ETHERNET)
DIAG(F("Ethernet reply socket=%d, count=%d, buf:%e"), socketOut,count,tmpbuf);
clients[socketOut].write(tmpbuf,count);
}
// do trust write does its thing and not flush
Expand Down

0 comments on commit c8c3697

Please sign in to comment.