Skip to content

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

Merged
merged 3 commits into from
Jan 31, 2017

Conversation

joelucid
Copy link
Contributor

No description provided.

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;
Copy link
Member

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
Copy link
Member

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.

@joelucid
Copy link
Contributor Author

Both requested changes done.

@igrr igrr merged commit 61787b2 into esp8266:master Jan 31, 2017
@codecov-io
Copy link

Codecov Report

Merging #2874 into master will not impact coverage.

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

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a444898...174bdf4. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants