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 authored and ballard26 committed Oct 2, 2024
1 parent b080531 commit cdb6c0e
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 cdb6c0e

Please sign in to comment.