From 55d1f4cc7fa895386b278fb67f894d219b80ba94 Mon Sep 17 00:00:00 2001 From: Mutzi Date: Sat, 13 Apr 2024 14:01:06 +0200 Subject: [PATCH] Maybe fix large file downloads --- src/server/download.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/download.cxx b/src/server/download.cxx index a9a7465..ce28db0 100644 --- a/src/server/download.cxx +++ b/src/server/download.cxx @@ -58,6 +58,7 @@ void Server::download(const std::shared_ptr &s) { restbed::Bytes buf(1024*1024*4, 0); std::ifstream f{user->user_dir / std::to_string(node->id)}; while (!f.eof()) { + buf.resize(buf.capacity()); f.read((char*)buf.data(), buf.size()); buf.resize(f.gcount()); s->yield(buf);