nghttpx: Reset quic upstream addr fd to the current path

This commit is contained in:
Tatsuhiro Tsujikawa
2026-07-29 20:16:46 +09:00
parent a399ab720d
commit dedad37def
2 changed files with 16 additions and 0 deletions

View File

@@ -756,6 +756,7 @@ std::expected<void, Error> Http3Upstream::on_write() {
}
handler_->get_connection()->wlimit.stopw();
reset_upstream_addr_fd();
if (auto rv = write_streams(); !rv) {
return rv;
@@ -770,6 +771,20 @@ std::expected<void, Error> Http3Upstream::on_write() {
return {};
}
void Http3Upstream::reset_upstream_addr_fd() {
auto path = ngtcp2_conn_get_path2(conn_);
auto faddr = static_cast<const UpstreamAddr *>(path->user_data);
auto conn = handler_->get_connection();
if (faddr->fd == conn->wev.fd) {
return;
}
assert(!ev_is_active(&conn->wev));
ev_io_set(&conn->wev, faddr->fd, EV_WRITE);
}
namespace {
ngtcp2_ssize write_pkt(ngtcp2_conn *conn, ngtcp2_path *path,
ngtcp2_pkt_info *pi, uint8_t *dest, size_t destlen,

View File

@@ -193,6 +193,7 @@ public:
std::span<const uint8_t> data, size_t gso_size);
void send_blocked_packet();
void signal_write_upstream_addr(const UpstreamAddr *faddr);
void reset_upstream_addr_fd();
ngtcp2_conn *get_conn() const;