case 4705 - licence fetch and trial request fall back to every licence server
DoFetchAsync rethrew a connection error after the fourth server, so sockeye.ayanova.com was never tried; it now rethrows after the last one. The trial request (rvr) went to rockfish only and now uses the same fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -510,12 +510,12 @@ namespace AyaNova.Core
|
||||
trialRequest.Perpetual = true;
|
||||
#endif
|
||||
log.LogDebug($"Requesting trial license for DBID {LicenseDbId}");
|
||||
string sUrl = $"{LICENSE_SERVER_URL_ROCKFISH}rvr";
|
||||
try
|
||||
{
|
||||
var content = new StringContent(JsonConvert.SerializeObject(trialRequest), Encoding.UTF8, "application/json");
|
||||
var client = ServiceProviderProvider.HttpClientFactory.CreateClient();
|
||||
var res = await client.PostAsync(sUrl, content);
|
||||
//case 4705: the same fallback servers as a license fetch (was rockfish only)
|
||||
var res = await DoFetchAsync("rvr", content, client);
|
||||
var responseText = await res.Content.ReadAsStringAsync();
|
||||
if (res.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -632,6 +632,7 @@ namespace AyaNova.Core
|
||||
}
|
||||
}
|
||||
|
||||
//Posts to the license servers in turn, moving to the next only when one can't be reached (license fetch and trial request)
|
||||
private static async Task<HttpResponseMessage> DoFetchAsync(string LicenseUrlParameters, StringContent content, HttpClient client)
|
||||
{
|
||||
var LicenseServer = string.Empty;
|
||||
@@ -663,11 +664,12 @@ namespace AyaNova.Core
|
||||
}
|
||||
catch (System.Net.Http.HttpRequestException)
|
||||
{
|
||||
if (x == 3)
|
||||
//case 4705: rethrow after the last server (was after the fourth, so sockeye was never tried)
|
||||
if (x == 4)
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return null;//not reached: the last server returns or throws
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user