Skip to content

Commit b7ff1b7

Browse files
committed
fixes if add() is successful but send() is not
[pull request 144](me-no-dev#144)
1 parent e5eb6be commit b7ff1b7

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
@@ -1059,9 +1059,12 @@ size_t AsyncClient::write(const char* data) {
10591059

10601060
size_t AsyncClient::write(const char* data, size_t size, uint8_t apiflags) {
10611061
size_t will_send = add(data, size, apiflags);
1062-
if(!will_send || !send()) {
1062+
if(!will_send) {
10631063
return 0;
10641064
}
1065+
while(connected() && !send()) {
1066+
taskYIELD();
1067+
}
10651068
return will_send;
10661069
}
10671070

0 commit comments

Comments
 (0)