From 127f3acce53254130077b1e726d41aad0097a37a Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 9 Aug 2024 11:46:33 +0200 Subject: [PATCH] send whole outbuffer --- EthernetInterface.cpp | 10 +++++++++- GITHUB_SHA.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index ef08a1b3..a7ca0bed 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -209,6 +209,7 @@ void EthernetInterface::loop2() { if (Diag::ETHERNET) DIAG(F("Ethernet: available socket=%d,avail=%d"), socket, available); // read bytes from a client int count = clients[socket].read(buffer, MAX_ETH_BUFFER); + looptimer(8000, F("Ethloop2 read")); buffer[count] = '\0'; // terminate the string properly if (Diag::ETHERNET) DIAG(F(",count=%d:%e"), count, buffer); // execute with data going directly back @@ -239,7 +240,14 @@ void EthernetInterface::loop2() { } else if (socketOut >= 0) { int count=outboundRing->count(); if (Diag::ETHERNET) DIAG(F("Ethernet reply socket=%d, count=:%d"), socketOut,count); - for(;count>0;count--) clients[socketOut].write(outboundRing->read()); + { + char buffer[count+1]; // one extra for '\0' + for(int i=0;iread(); + } + buffer[count]=0; + clients[socketOut].write(buffer,count); + } clients[socketOut].flush(); //maybe } looptimer(8000, F("Ethloop after outbound")); diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index febb419b..eca7c82f 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-fozzie-202408080852Z" +#define GITHUB_SHA "devel-fozzie-202408090945Z"