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