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; return;
remoteHostName = address; remoteHostName = address;
remoteAddr = DNS::Resolve(address);
remotePort = port; remotePort = port;
if (addrType == AddrType::IPV6) if (addrType == AddrType::IPV6)
{
if (IsIPv6Only())
remoteAddr = DNS::Resolve(AddrType::IPV6, address);
else
remoteAddr = DNS::Resolve(address);
Connect_v6(remoteAddr, port); Connect_v6(remoteAddr, port);
}
else if (addrType == AddrType::IPV4) else if (addrType == AddrType::IPV4)
{
remoteAddr = DNS::Resolve(AddrType::IPV4, address);
Connect_v4(remoteAddr, port); Connect_v4(remoteAddr, port);
}
connected = true; connected = true;
} }

View File

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

View File

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