void FilterManager::addStreamEncoderFilterWorker(StreamEncoderFilterSharedPtr filter,
                                                 FilterMatchStateSharedPtr match_state,
                                                 bool dual_filter) {
  ActiveStreamEncoderFilterPtr wrapper(
      new ActiveStreamEncoderFilter(*this, filter, match_state, dual_filter));

  if (match_state) {
    match_state->filter_ = filter.get();
  }

  filter->setEncoderFilterCallbacks(*wrapper);
  // Note: configured encoder filters are prepended to encoder_filters_.
  // This means that if filters are configured in the following order (assume all three filters are
  // both decoder/encoder filters):
  //   http_filters:
  //     - A
  //     - B
  //     - C
  // The encoder filter chain will iterate through filters C, B, A.
  LinkedList::moveIntoList(std::move(wrapper), encoder_filters_);
}
void FilterManager::addStreamEncoderFilterWorker(StreamEncoderFilterSharedPtr filter,
                                                 FilterMatchStateSharedPtr match_state,
                                                 bool dual_filter) {
  ActiveStreamEncoderFilterPtr wrapper(
      new ActiveStreamEncoderFilter(*this, filter, match_state, dual_filter));

  if (match_state) {
    match_state->filter_ = filter.get();
  }

  filter->setEncoderFilterCallbacks(*wrapper);
   
   
   
   
   
   
   
   
  LinkedList::moveIntoList(std::move(wrapper), encoder_filters_);
}