8000 fixes for WiFiClient::write(Stream) by d-a-v · Pull Request #7987 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

fixes for WiFiClient::write(Stream) #7987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
honor timeout in all case, avoid short transfer when output is tempor…
…arilly full
  • Loading branch information
d-a-v committed Apr 21, 2021
commit 40316a8e99eb1017e4256c5e1753dd6ae57e147a
33 changes: 3 additions & 30 deletions cores/esp8266/StreamSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
{
peekConsume(w);
written += w;
if (maxLen)
{
timedOut.reset();
}
timedOut.reset(); // something has been written
}
if (foundChar)
{
Expand All @@ -116,12 +113,6 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
}
}

if (!w && !maxLen && readUntilChar < 0)
{
// nothing has been transferred and no specific condition is requested
break;
}

if (timedOut)
{
// either (maxLen>0) nothing has been transferred for too long
Expand Down Expand Up @@ -195,16 +186,7 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
break;
}
written += 1;
if (maxLen)
{
timedOut.reset();
}
}

if (!w && !maxLen && readUntilChar < 0)
{
// nothing has been transferred and no specific condition is requested
break;
timedOut.reset(); // something has been written
}

if (timedOut)
Expand Down Expand Up @@ -288,16 +270,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
setReport(Report::WriteError);
break;
}
if (maxLen && w)
{
timedOut.reset();
}
}

if (!w && !maxLen)
{
// nothing has been transferred and no specific condition is requested
break;
timedOut.reset(); // something has been written
}

if (timedOut)
Expand Down
0