Maybe fix large file downloads
Some checks reported warnings
/ Build the server (push) Has been cancelled
Some checks reported warnings
/ Build the server (push) Has been cancelled
This commit is contained in:
parent
2a1c3a9f72
commit
55d1f4cc7f
@ -58,6 +58,7 @@ void Server::download(const std::shared_ptr<restbed::Session> &s) {
|
|||||||
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)};
|
||||||
while (!f.eof()) {
|
while (!f.eof()) {
|
||||||
|
buf.resize(buf.capacity());
|
||||||
f.read((char*)buf.data(), buf.size());
|
f.read((char*)buf.data(), buf.size());
|
||||||
buf.resize(f.gcount());
|
buf.resize(f.gcount());
|
||||||
s->yield(buf);
|
s->yield(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user