Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions source/extensions/filters/http/file_system_buffer/filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,10 @@ bool FileSystemBufferFilter::maybeStorage(BufferedStreamState& state,
// We can't use getSafeDispatcher here because we need to close the file if the filter
// was deleted before the callback, not just do nothing.
cancel_in_flight_async_action_ = config_->asyncFileManager().createAnonymousFile(
config_->storageBufferPath(), [this, me = std::weak_ptr(shared_from_this()),
dispatcher = &request_callbacks_->dispatcher(),
&state](absl::StatusOr<AsyncFileHandle> file_handle) {
config_->storageBufferPath(),
[this, me = std::weak_ptr<FileSystemBufferFilter>(shared_from_this()),
dispatcher = &request_callbacks_->dispatcher(),
&state](absl::StatusOr<AsyncFileHandle> file_handle) {
dispatcher->post([this, me = std::move(me), &state, file_handle]() {
if (!me.lock()) {
// If we opened a file but the filter went away in the meantime, close the file
Expand Down