This commit is contained in:
parent
1b1b045d46
commit
600a4a48b8
@ -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)};
|
||||||
|
Loading…
Reference in New Issue
Block a user