Skip to content

Commit

Permalink
httpd/file_handler: Always close stream
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Pope <[email protected]>
  • Loading branch information
BenPope committed Oct 1, 2024
1 parent f322e76 commit 9d4878d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http/file_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ future<std::unique_ptr<http::reply>> file_interaction_handler::read(
[file_name] (output_stream<char>& os) {
return open_file_dma(file_name, open_flags::ro).then([&os] (file f) {
return do_with(make_file_input_stream(std::move(f)), [&os](input_stream<char>& is) {
return copy(is, os).then([&os] {
return copy(is, os).finally([&os] {
return os.close();
}).then([&is] {
}).finally([&is] {
return is.close();
});
});
Expand Down

0 comments on commit 9d4878d

Please sign in to comment.