-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Allow for POSTs that are larger than a few 100 bytes. #2528
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
Conversation
Current coverage is 27.80% (diff: 100%)@@ master #2528 diff @@
==========================================
Files 20 20
Lines 3625 3625
Methods 335 335
Messages 0 0
Branches 656 656
==========================================
Hits 1008 1008
Misses 2441 2441
Partials 176 176
|
else | ||
if (written == 0) | ||
return returnError(HTTPC_ERROR_CONNECTION_LOST); | ||
byteswritten += size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 406 is incorrect. It should be:
byteswritten += written;
Chuck
Thanks for your PR, but the core and libraries have changed enough that this PR now has a merge conflict. Could you merge it manually with the latest core, so we can consider it for future releases? |
Thats a shame - as this code probably goes wrong in a second way - on short writes too.
|
Ok - so basically all we need to do is check the return of the write()s and
bytes_written = 0;
while(bytes_writen < len) {
r = write(buff + bytes_written, len - bytes_written);
if (r == 0)
return error that connection is lost
bytes_written += r;
}
And as far as I know there is no r = -1 with various ERRNO sort of things that need to be retried (EAGAIN, EINTR, BSD style). As ‘r’ seems to be a sssize_t.
Dw.
|
This is all @dirkx , whose PR unfortunately got borked when we were trying to update it to the new format. As @dirkx said: When sending POST responses of well over a K - _write() may not sent it all. Make sure we do -- but cap the individual writes - as somehow large 2-3k blobs seem to cause instability (on my 12F units). Supercedes esp8266#2528
This is all @dirkx , whose PR unfortunately got borked when we were trying to update it to the new format. As @dirkx said: When sending POST responses of well over a K - _write() may not sent it all. Make sure we do -- but cap the individual writes - as somehow large 2-3k blobs seem to cause instability (on my 12F units). Supercedes #2528
Superseded by #6800 which is now merged. Closing. |
When sending POST responses of well over a K - _write() may not sent it all. Make sure we do -- but cap the individual writes - as somehow large 2-3k blobs seem to cause instability (on my 12F units).