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);