// signal_write() to run on_write().
return HPE_PAUSED;
}
- llhttp_set_error_reason(htp, "could not finish request body");
- return HPE_USER;
+ return -1;
}
if (handler->get_http2_upgrade_allowed() &&
handler_->repeat_read_timer();
return resume_read(SHRPX_NO_BUFFER, nullptr, 0);
+ } else {
+ // If the request is not complete, close the connection.
+ delete_downstream();
+
+ handler_->set_should_close_after_write(true);
+
+ return 0;
}
}
return std::unique_ptr<Downstream>(downstream_.release());
}
-namespace {
-void write_altsvc(DefaultMemchunks *buf, BlockAllocator &balloc,
- const AltSvc &altsvc) {
- buf->append(util::percent_encode_token(balloc, altsvc.protocol_id));
- buf->append("=\"");
- buf->append(util::quote_string(balloc, altsvc.host));
- buf->append(':');
- buf->append(altsvc.service);
- buf->append('"');
-}
-} // namespace
-
int HttpsUpstream::on_downstream_header_complete(Downstream *downstream) {
if (LOG_ENABLED(INFO)) {
if (downstream->get_non_final_response()) {
// We won't change or alter alt-svc from backend for now
if (!httpconf.altsvcs.empty()) {
buf->append("Alt-Svc: ");
-
- auto &altsvcs = httpconf.altsvcs;
- write_altsvc(buf, downstream->get_block_allocator(), altsvcs[0]);
- for (size_t i = 1; i < altsvcs.size(); ++i) {
- buf->append(", ");
- write_altsvc(buf, downstream->get_block_allocator(), altsvcs[i]);
- }
+ buf->append(httpconf.altsvc_header_value);
buf->append("\r\n");
}
}