mirror of
https://github.com/nghttp2/nghttp2.git
synced 2026-08-06 00:59:18 +08:00
nghttpx: Reset quic upstream addr fd to the current path
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user