-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ClientConnection uses too much heap when streaming files #2871 #2874
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
const uint8_t* buf = _datasource->get_buffer(will_send); | ||
err_t err = tcp_write(_pcb, buf, will_send, TCP_WRITE_FLAG_COPY); | ||
_datasource->release_buffer(buf, will_send); | ||
size_t will_send = (can_send < left) ? can_send : left; |
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.
These lines seem to use TABs for indentation, but the original file uses spaces. Could you please reformat to match indentation of the surrounding code?
@@ -333,6 +333,7 @@ class ClientContext | |||
return _written; | |||
} | |||
|
|||
#define TCP_WRITE_CHUNK_SIZE 256 |
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.
Can we change this to a ClientContext member variable? Then we can later add an API to WiFiClient to configure the chunk size at runtime. This variable can be default-initalized to 256 for now.
Both requested changes done. |
Codecov Report@@ Coverage Diff @@
## master #2874 +/- ##
======================================
Coverage 27.8% 27.8%
======================================
Files 20 20
Lines 3625 3625
Branches 656 656
======================================
Hits 1008 1008
Misses 2441 2441
Partials 176 176 Continue to review full report at Codecov.
|
No description provided.