diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 3a669698a2a..8ef35652f50 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -22,6 +22,7 @@ We suggest to delay the adoption of the new format until a stable 1.5.x is relea * avr: Fixed timeout in Bridge::transfer() * sam: Fixed SPI initialization (when using extended API and multiple CS) * avr: Fixed behavior of EthernetClient::flush() +* avr: Improved return value of EthernetServer::write() [core] * sam: Fixed wrong initialization for ADC timings (analogRead speed Arduino DUE improved by a factor x10) diff --git a/libraries/Ethernet/src/EthernetServer.cpp b/libraries/Ethernet/src/EthernetServer.cpp index 6d6ce8c8027..208c6ca91f3 100644 --- a/libraries/Ethernet/src/EthernetServer.cpp +++ b/libraries/Ethernet/src/EthernetServer.cpp @@ -83,7 +83,9 @@ size_t EthernetServer::write(const uint8_t *buffer, size_t size) if (EthernetClass::_server_port[sock] == _port && client.status() == SnSR::ESTABLISHED) { - n += client.write(buffer, size); + size_t res = client.write(buffer, size); + if (res > n) + n = res; } }