Skip to content

Commit 3e300fd

Browse files
committed
fixes if add() is successful but send() is not, write() will return no bytes written however the bytes still get added in the queue to be sent me-no-dev#144 me-no-dev#144
1 parent ca8ac5f commit 3e300fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AsyncTCP.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,12 @@ size_t AsyncClient::write(const char* data) {
10171017

10181018
size_t AsyncClient::write(const char* data, size_t size, uint8_t apiflags) {
10191019
size_t will_send = add(data, size, apiflags);
1020-
if(!will_send || !send()) {
1020+
if (!will_send) {
10211021
return 0;
10221022
}
1023+
while (connected() && !send()) {
1024+
taskYIELD();
1025+
}
10231026
return will_send;
10241027
}
10251028

0 commit comments

Comments
 (0)