Allow for POSTs that are larger than a few 100 bytes.#2528
Closed
dirkx wants to merge 2 commits intoesp8266:masterfrom
Closed
Allow for POSTs that are larger than a few 100 bytes.#2528dirkx wants to merge 2 commits intoesp8266:masterfrom
dirkx wants to merge 2 commits intoesp8266:masterfrom
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
|
stickbreaker
suggested changes
Sep 27, 2016
| else | ||
| if (written == 0) | ||
| return returnError(HTTPC_ERROR_CONNECTION_LOST); | ||
| byteswritten += size; |
There was a problem hiding this comment.
Line 406 is incorrect. It should be:
byteswritten += written;Chuck
Collaborator
|
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? |
Author
|
Thats a shame - as this code probably goes wrong in a second way - on short writes too.
|
Collaborator
Author
|
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.
|
earlephilhower
added a commit
to earlephilhower/Arduino
that referenced
this pull request
Nov 18, 2019
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
devyte
pushed a commit
that referenced
this pull request
Nov 24, 2019
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
Collaborator
|
Superseded by #6800 which is now merged. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).