Skip to content

Failed to send a little bit large file. #4438

Closed Answered by thomaseizinger
blackshadowsoftwareltd asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, there is a maximum amount that we will allocate:

/// Max request size in bytes
const REQUEST_SIZE_MAXIMUM: u64 = 1024 * 1024;
/// Max response size in bytes
const RESPONSE_SIZE_MAXIMUM: u64 = 10 * 1024 * 1024;

This MUST be bounded otherwise you are vulnerable to DoS attacks because the remote can send you random garbage and you allocate 10MB per stream and eventually run out of memory. If you want to transfer large files, you'll need to chunk them somehow.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@thomaseizinger
Comment options

@blackshadowsoftwareltd
Comment options

@thomaseizinger
Comment options

Answer selected by blackshadowsoftwareltd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants