Fixed download
All checks were successful
/ Build the server (push) Successful in 4m0s

This commit is contained in:
Mutzi 2023-10-23 12:10:21 +02:00
parent 1b1b045d46
commit 600a4a48b8
Signed by: root
GPG Key ID: 2437494E09F13876

View File

@ -53,7 +53,7 @@ void Server::download(const std::shared_ptr<restbed::Session> &s) {
{"Content-Length", std::to_string(node->size)}, {"Content-Length", std::to_string(node->size)},
{"Content-Disposition", "attachment; filename=\"" + node->name + "\""} {"Content-Disposition", "attachment; filename=\"" + node->name + "\""}
}, },
[&](const std::shared_ptr<restbed::Session>& s) { [user=user, node=node](const std::shared_ptr<restbed::Session>& s) {
std::shared_lock lock{user->node_lock}; std::shared_lock lock{user->node_lock};
restbed::Bytes buf(1024*1024*4, 0); restbed::Bytes buf(1024*1024*4, 0);
std::ifstream f{user->user_dir / std::to_string(node->id)}; std::ifstream f{user->user_dir / std::to_string(node->id)};