When lwipClient::write() encounters an error from tcp_write() or tcp_output(), it returns 0. In contrast, Print::write(), which it overrides, as well as EthernetClient::write() from the Ethernet library, both return the number of bytes written, which may or may not be 0.
This can be easily changed by returning bytes_sent instead of 0 in each return statement (e.g. 36a9775); however this assumes that an error from tcp_write() indicates that no bytes have been written to the pcb send buffer, and I don't know if that assumption is correct.
PR #234 appears to fix this issue.
When
lwipClient::write()encounters an error fromtcp_write()ortcp_output(), it returns 0. In contrast,Print::write(), which it overrides, as well asEthernetClient::write()from the Ethernet library, both return the number of bytes written, which may or may not be 0.This can be easily changed by returning
bytes_sentinstead of 0 in each return statement (e.g. 36a9775); however this assumes that an error fromtcp_write()indicates that no bytes have been written to thepcbsend buffer, and I don't know if that assumption is correct.PR #234 appears to fix this issue.