void prepare_status_response(Stream *stream, Http2Handler *hd, int status) {
  auto sessions = hd->get_sessions();
  auto status_page = sessions->get_server()->get_status_page(status);
  auto file_ent = &status_page->file_ent;

  // we don't set stream->file_ent since we don't want to expire it.
  stream->body_length = file_ent->length;
  nghttp2_data_provider data_prd;
  data_prd.source.fd = file_ent->fd;
  data_prd.read_callback = file_read_callback;

  HeaderRefs headers;
  headers.reserve(2);
  headers.emplace_back(StringRef::from_lit("content-type"),
                       StringRef::from_lit("text/html; charset=UTF-8"));
  headers.emplace_back(
      StringRef::from_lit("content-length"),
      util::make_string_ref_uint(stream->balloc, file_ent->length));
  hd->submit_response(StringRef{status_page->status}, stream->stream_id,
                      headers, &data_prd);
}
void prepare_status_response(Stream *stream, Http2Handler *hd, int status) {
  auto sessions = hd->get_sessions();
  auto status_page = sessions->get_server()->get_status_page(status);
  auto file_ent = &status_page->file_ent;

   
  stream->body_length = file_ent->length;
  nghttp2_data_provider data_prd;
  data_prd.source.fd = file_ent->fd;
  data_prd.read_callback = file_read_callback;

  HeaderRefs headers;
  headers.reserve(2);
  headers.emplace_back(StringRef::from_lit("content-type"),
                       StringRef::from_lit("text/html; charset=UTF-8"));
  headers.emplace_back(
      StringRef::from_lit("content-length"),
      util::make_string_ref_uint(stream->balloc, file_ent->length));
  hd->submit_response(StringRef{status_page->status}, stream->stream_id,
                      headers, &data_prd);
}