refactor: remove unused UTP Socket code. (#4409)

This commit is contained in:
Reed Morrison 2022-12-19 13:16:46 -08:00 committed by GitHub
parent 5743758edd
commit edfce44d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 37 deletions

View File

@ -129,34 +129,3 @@ size_t tr_peer_socket::try_read(Buffer& buf, size_t max, tr_error** error) const
return {};
}
tr_peer_socket tr_netOpenPeerUTPSocket(
tr_session* session,
tr_address const& addr,
tr_port port,
bool /*client_is_seed*/,
void* userdata)
{
auto ret = tr_peer_socket{};
if (session->utp_context != nullptr && addr.is_valid_for_peers(port))
{
auto const [ss, sslen] = addr.to_sockaddr(port);
if (auto* const sock = utp_create_socket(session->utp_context); sock != nullptr)
{
utp_set_userdata(sock, userdata);
if (utp_connect(sock, reinterpret_cast<sockaddr const*>(&ss), sslen) != -1)
{
ret = tr_peer_socket{ addr, port, sock };
}
else
{
utp_close(sock);
}
}
}
return ret;
}

View File

@ -139,9 +139,3 @@ private:
};
tr_peer_socket tr_netOpenPeerSocket(tr_session* session, tr_address const& addr, tr_port port, bool client_is_seed);
tr_peer_socket tr_netOpenPeerUTPSocket(
tr_session* session,
tr_address const& addr,
tr_port port,
bool client_is_seed,
void* userdata);