diff --git a/libtransmission/session.cc b/libtransmission/session.cc index 4e264e1df..0080615c5 100644 --- a/libtransmission/session.cc +++ b/libtransmission/session.cc @@ -299,7 +299,7 @@ std::optional tr_session::WebMediator::userAgent() const return TR_NAME "/" SHORT_VERSION_STRING; } -std::optional tr_session::WebMediator::publicAddressV4() const +std::optional tr_session::WebMediator::bind_address_V4() const { if (auto const addr = session_->bind_address(TR_AF_INET); !addr.is_any()) { @@ -309,7 +309,7 @@ std::optional tr_session::WebMediator::publicAddressV4() const return std::nullopt; } -std::optional tr_session::WebMediator::publicAddressV6() const +std::optional tr_session::WebMediator::bind_address_V6() const { if (auto const addr = session_->bind_address(TR_AF_INET6); !addr.is_any()) { diff --git a/libtransmission/session.h b/libtransmission/session.h index d92560a8b..8b925fb74 100644 --- a/libtransmission/session.h +++ b/libtransmission/session.h @@ -236,8 +236,8 @@ private: } [[nodiscard]] std::optional cookieFile() const override; - [[nodiscard]] std::optional publicAddressV4() const override; - [[nodiscard]] std::optional publicAddressV6() const override; + [[nodiscard]] std::optional bind_address_V4() const override; + [[nodiscard]] std::optional bind_address_V6() const override; [[nodiscard]] std::optional userAgent() const override; [[nodiscard]] size_t clamp(int torrent_id, size_t byte_count) const override; [[nodiscard]] time_t now() const override; diff --git a/libtransmission/web.cc b/libtransmission/web.cc index aed8dcafd..2d8cde154 100644 --- a/libtransmission/web.cc +++ b/libtransmission/web.cc @@ -310,19 +310,19 @@ public: } } - [[nodiscard]] auto publicAddress() const + [[nodiscard]] auto bind_address() const { switch (options.ip_proto) { case FetchOptions::IPProtocol::V4: - return impl.mediator.publicAddressV4(); + return impl.mediator.bind_address_V4(); case FetchOptions::IPProtocol::V6: - return impl.mediator.publicAddressV6(); + return impl.mediator.bind_address_V6(); default: - auto ip = impl.mediator.publicAddressV4(); + auto ip = impl.mediator.bind_address_V4(); if (ip == std::nullopt) { - ip = impl.mediator.publicAddressV6(); + ip = impl.mediator.bind_address_V6(); } return ip; @@ -571,7 +571,7 @@ public: (void)curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, &tr_web::Impl::onDataReceived); (void)curl_easy_setopt(e, CURLOPT_MAXREDIRS, MaxRedirects); - if (auto const addrstr = task.publicAddress(); addrstr) + if (auto const addrstr = task.bind_address(); addrstr) { (void)curl_easy_setopt(e, CURLOPT_INTERFACE, addrstr->c_str()); } diff --git a/libtransmission/web.h b/libtransmission/web.h index b68ebfb6f..c427ca390 100644 --- a/libtransmission/web.h +++ b/libtransmission/web.h @@ -123,13 +123,13 @@ public: } // Return IPv4 user public address string, or nullopt to not use one - [[nodiscard]] virtual std::optional publicAddressV4() const + [[nodiscard]] virtual std::optional bind_address_V4() const { return std::nullopt; } // Return IPv6 user public address string, or nullopt to not use one - [[nodiscard]] virtual std::optional publicAddressV6() const + [[nodiscard]] virtual std::optional bind_address_V6() const { return std::nullopt; }