Fixed Spotify.Play and fixed TCP.Connect.

This commit is contained in:
Arron David Nelson 2024-07-09 17:39:01 -07:00
parent 4e887b1ac2
commit fa2b801690
3 changed files with 23 additions and 6 deletions

View File

@ -213,13 +213,23 @@ namespace ehs
return;
remoteHostName = address;
remoteAddr = DNS::Resolve(address);
remotePort = port;
if (addrType == AddrType::IPV6)
{
if (IsIPv6Only())
remoteAddr = DNS::Resolve(AddrType::IPV6, address);
else
remoteAddr = DNS::Resolve(address);
Connect_v6(remoteAddr, port);
}
else if (addrType == AddrType::IPV4)
{
remoteAddr = DNS::Resolve(AddrType::IPV4, address);
Connect_v4(remoteAddr, port);
}
connected = true;
}

View File

@ -242,13 +242,23 @@ namespace ehs
return;
remoteHostName = address;
remoteAddr = DNS::Resolve(address);
remotePort = port;
if (addrType == AddrType::IPV6)
{
if (IsIPv6Only())
remoteAddr = DNS::Resolve(AddrType::IPV6, address);
else
remoteAddr = DNS::Resolve(address);
Connect_v6(remoteAddr, port);
}
else if (addrType == AddrType::IPV4)
{
remoteAddr = DNS::Resolve(AddrType::IPV4, address);
Connect_v4(remoteAddr, port);
}
connected = true;
}

View File

@ -155,9 +155,6 @@ namespace ehs
Request req(Verb::PUT, "/v1/me/player/play");
req.BearerAuth(token);
client.Release();
client.Initialize();
client.Connect("", SSL::HTTPS_Port);
client.SendReq(req);
Response res = client.RecvRes();
@ -590,7 +587,7 @@ namespace ehs
bool Spotify::ReAuthorize()
{
SSL accounts;
SSL accounts(AddrType::IPV4);
accounts.Initialize();
accounts.Connect("accounts.spotify.com", SSL::HTTPS_Port);