-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Fixes large payload issues for sendRequest #7051
Conversation
sendRequest has a major problem when sending a big payload, the comparator in the IF loop has its two operators changed, so the last part of payload is never sent
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.
Approving (even if it could be more simple by just commenting size -= written
like suggested in #7049)
commenting
It may take some random info from payload pointer |
That is very true. But (I'm still approving your PR, other maintainers will comment) |
That´s right too. I haven´t ckeck the code in function |
It's more of a History/Legacy leftover. |
This will likely get simplified with #6979 , but merging for the immediate need. |
Is it possible this also may fix an issue I was having with running out of memory after a number of failed connection attempts to an MQTT broker? |
This is unrelated because pubsubclient does not use HTTPClient. |
OK, thanks, that does limit my search to the real problem that may have been fixed now :) |
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
sendRequest has a major problem when sending a big payload, the comparator in the IF loop has its two operators changed at the same time, so the last part of payload is never sent. This is seen when you try to send a payload that needs more than one operation.
The modification has been tested for a 1500 bytes payload.
edit from maintainer: fixes #7049