Skip to content
Snippets Groups Projects
Commit bff925b6 authored by Ada Böhm's avatar Ada Böhm
Browse files

ENH: Bigger buffer when receiving in stream mode

parent 7131a39b
No related branches found
No related tags found
No related merge requests found
...@@ -100,8 +100,15 @@ void Socket::send(std::unique_ptr<SendBuffer> buffer) ...@@ -100,8 +100,15 @@ void Socket::send(std::unique_ptr<SendBuffer> buffer)
void Socket::_buf_alloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) void Socket::_buf_alloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
{ {
buf->base = new char[suggested_size]; size_t size;
buf->len = suggested_size; Socket *socket = static_cast<Socket*>(handle->data);
if (socket->stream_mode) {
size = 8 << 20; // 8 MB
} else {
size = suggested_size;
}
buf->base = new char[size];
buf->len = size;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment