1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 00:04:43 +01:00

Fix #11298: Unable to advertise server (500): Retry with ipv4 only (#11824)

Add new config option to allow any address to be advertised. This then
doesn't rely on the master server retrieving the server IP address via
the HTTP request which can often be IPv6 by default.
This commit is contained in:
Ted John
2020-05-30 17:21:22 +01:00
committed by GitHub
parent 7b8257c692
commit 8f77125cdb
5 changed files with 19 additions and 4 deletions

View File

@@ -177,10 +177,16 @@ namespace Http
if (hConnect == nullptr)
ThrowWin32Exception("WinHttpConnect");
auto dwFlags = 0;
if (lstrcmpiW(std::wstring(url.lpszScheme, url.dwSchemeLength).c_str(), L"https") == 0)
{
dwFlags = WINHTTP_FLAG_SECURE;
}
auto wVerb = GetVerb(req.method);
auto wQuery = std::wstring(url.lpszUrlPath, url.dwUrlPathLength);
hRequest = WinHttpOpenRequest(
hConnect, wVerb, wQuery.c_str(), NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE);
hConnect, wVerb, wQuery.c_str(), NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, dwFlags);
if (hRequest == nullptr)
ThrowWin32Exception("WinHttpOpenRequest");