Status ConnectionImpl::onHeaderField(const char* data, size_t length) {
  ASSERT(dispatching_);

  getBytesMeter().addHeaderBytesReceived(length);

  // We previously already finished up the headers, these headers are
  // now trailers.
  if (header_parsing_state_ == HeaderParsingState::Done) {
    if (!enableTrailers()) {
      // Ignore trailers.
      return okStatus();
    }
    processing_trailers_ = true;
    header_parsing_state_ = HeaderParsingState::Field;
    allocTrailers();
  }
  if (header_parsing_state_ == HeaderParsingState::Value) {
    RETURN_IF_ERROR(completeLastHeader());
  }

  current_header_field_.append(data, length);

  return checkMaxHeadersSize();
}
Status ConnectionImpl::onHeaderField(const char* data, size_t length) {
  ASSERT(dispatching_);

  getBytesMeter().addHeaderBytesReceived(length);

   
   
  if (header_parsing_state_ == HeaderParsingState::Done) {
    if (!enableTrailers()) {
       
      return okStatus();
    }
    processing_trailers_ = true;
    header_parsing_state_ = HeaderParsingState::Field;
    allocTrailers();
  }
  if (header_parsing_state_ == HeaderParsingState::Value) {
    RETURN_IF_ERROR(completeLastHeader());
  }

  current_header_field_.append(data, length);

  return checkMaxHeadersSize();
}