void Filter::onUpstreamAbort(Http::Code code, StreamInfo::ResponseFlag response_flags,
                             absl::string_view body, bool dropped, absl::string_view details) {
  // If we have not yet sent anything downstream, send a response with an appropriate status code.
  // Otherwise just reset the ongoing response.
  callbacks_->streamInfo().setResponseFlag(response_flags);
  if (downstream_response_started_ &&
      !Runtime::runtimeFeatureEnabled("envoy.reloadable_features.allow_500_after_100")) {
    // This will destroy any created retry timers.
    callbacks_->streamInfo().setResponseCodeDetails(details);
    cleanup();
    callbacks_->resetStream();
  } else {
    // This will destroy any created retry timers.
    cleanup();
    // sendLocalReply may instead reset the stream if downstream_response_started_ is true.
    callbacks_->sendLocalReply(
        code, body,
        [dropped, this](Http::ResponseHeaderMap& headers) {
          if (dropped && !config_.suppress_envoy_headers_) {
            headers.addReference(Http::Headers::get().EnvoyOverloaded,
                                 Http::Headers::get().EnvoyOverloadedValues.True);
          }
          modify_headers_(headers);
        },
        absl::nullopt, details);
  }
}
void Filter::onUpstreamAbort(Http::Code code, StreamInfo::ResponseFlag response_flags,
                             absl::string_view body, bool dropped, absl::string_view details) {
   
   
  callbacks_->streamInfo().setResponseFlag(response_flags);
  if (downstream_response_started_ &&
      !Runtime::runtimeFeatureEnabled("envoy.reloadable_features.allow_500_after_100")) {
     
    callbacks_->streamInfo().setResponseCodeDetails(details);
    cleanup();
    callbacks_->resetStream();
  } else {
     
    cleanup();
     
    callbacks_->sendLocalReply(
        code, body,
        [dropped, this](Http::ResponseHeaderMap& headers) {
          if (dropped && !config_.suppress_envoy_headers_) {
            headers.addReference(Http::Headers::get().EnvoyOverloaded,
                                 Http::Headers::get().EnvoyOverloadedValues.True);
          }
          modify_headers_(headers);
        },
        absl::nullopt, details);
  }
}