Allow for POSTs that are larger than a few 100 bytes. by dirkx · Pull Request #2528 · esp8266/Arduino (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits2 Checks0 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

dirkx

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).

@dirkx

@codecov-io

Current coverage is 27.80% (diff: 100%)

Merging #2528 into master will not change coverage

@@ 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

Powered by Codecov. Last update 4897e00...268f200

stickbreaker

else
if (written == 0)
return returnError(HTTPC_ERROR_CONNECTION_LOST);
byteswritten += size;

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:

Chuck

@earlephilhower

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?

@dirkx

Thats a shame - as this code probably goes wrong in a second way - on short writes too.

@d-a-v

@d-a-v

I'm sorry I broke it while trying to merge by hand. @dirkx I'm going to PR on your fork to fix my mistake.
edit: fixed

@dirkx

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

@earlephilhower

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

@earlephilhower @devyte

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

@earlephilhower

Superseded by #6800 which is now merged. Closing.