From 600a4a48b88638f5b1a81102e2b9e569d8f89183 Mon Sep 17 00:00:00 2001 From: Mutzi Date: Mon, 23 Oct 2023 12:10:21 +0200 Subject: [PATCH] Fixed download --- src/server/download.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/download.cxx b/src/server/download.cxx index 418a41a..a9a7465 100644 --- a/src/server/download.cxx +++ b/src/server/download.cxx @@ -53,7 +53,7 @@ void Server::download(const std::shared_ptr &s) { {"Content-Length", std::to_string(node->size)}, {"Content-Disposition", "attachment; filename=\"" + node->name + "\""} }, - [&](const std::shared_ptr& s) { + [user=user, node=node](const std::shared_ptr& s) { std::shared_lock lock{user->node_lock}; restbed::Bytes buf(1024*1024*4, 0); std::ifstream f{user->user_dir / std::to_string(node->id)};