Merge branch 'master' into dev

This commit is contained in:
Dominion
2023-06-11 12:48:46 -04:00
6 changed files with 19 additions and 29 deletions
+2 -2
View File
@@ -5,8 +5,8 @@
#define DMAPI5_TOPIC_DATA "tgs_data"
#define DMAPI5_BRIDGE_REQUEST_LIMIT 8198
#define DMAPI5_TOPIC_REQUEST_LIMIT 65529
#define DMAPI5_TOPIC_RESPONSE_LIMIT 65528
#define DMAPI5_TOPIC_REQUEST_LIMIT 65528
#define DMAPI5_TOPIC_RESPONSE_LIMIT 65529
#define DMAPI5_BRIDGE_COMMAND_PORT_UPDATE 0
#define DMAPI5_BRIDGE_COMMAND_STARTUP 1
@@ -42,12 +42,12 @@ namespace Tgstation.Server.Host.Components.Interop
/// <summary>
/// The maximum length in bytes of a <see cref="global::Byond.TopicSender.ITopicClient"/> payload.
/// </summary>
public const uint MaximumTopicRequestLength = 65529;
public const uint MaximumTopicRequestLength = 65528;
/// <summary>
/// The maximum length in bytes of a <see cref="global::Byond.TopicSender.ITopicClient"/> response.
/// </summary>
public const uint MaximumTopicResponseLength = 65528;
public const uint MaximumTopicResponseLength = 65529;
/// <summary>
/// The DMAPI <see cref="InteropVersion"/> being used.
@@ -227,28 +227,28 @@ namespace Tgstation.Server.Host.Components.StaticFiles
void ListImpl()
{
var enumerator = synchronousIOManager.GetDirectories(path, cancellationToken);
try
{
var enumerator = synchronousIOManager.GetDirectories(path, cancellationToken);
result.AddRange(enumerator.Select(x => new ConfigurationFileResponse
{
IsDirectory = true,
Path = ioManager.ConcatPath(configurationRelativePath, x),
}).OrderBy(file => file.Path));
enumerator = synchronousIOManager.GetFiles(path, cancellationToken);
result.AddRange(enumerator.Select(x => new ConfigurationFileResponse
{
IsDirectory = false,
Path = ioManager.ConcatPath(configurationRelativePath, x),
}).OrderBy(file => file.Path));
}
catch (IOException e)
catch (IOException ex)
{
logger.LogDebug(e, "IOException while writing {path}!", path);
logger.LogDebug(ex, "IOException while enumerating direcotry!");
result = null;
return;
}
enumerator = synchronousIOManager.GetFiles(path, cancellationToken);
result.AddRange(enumerator.Select(x => new ConfigurationFileResponse
{
IsDirectory = false,
Path = ioManager.ConcatPath(configurationRelativePath, x),
}).OrderBy(file => file.Path));
}
using (await SemaphoreSlimContext.Lock(semaphore, cancellationToken))
@@ -66,7 +66,7 @@
<!-- Usage: Concise throw statements for native Win32 errors -->
<PackageReference Include="BetterWin32Errors" Version="0.2.0" />
<!-- Usage: Interop with BYOND's /world/Topic -->
<PackageReference Include="Byond.TopicSender" Version="5.0.0" />
<PackageReference Include="Byond.TopicSender" Version="7.0.1" />
<!-- Usage: 503'ing request pipeline until server is finished initializing -->
<PackageReference Include="Cyberboss.AspNetCore.AsyncInitializer" Version="1.2.0" />
<!-- Usage: IRC interop -->
@@ -92,8 +92,6 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.16" />
<!-- Usage: MSSQL ORM plugin -->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.16" />
<!-- Usage: Included transitively through other packages, workaround for https://github.com/coverlet-coverage/coverlet/issues/1381 -->
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
<!-- Usage: POSIX support for syscalls, signals, and symlinks -->
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
<!-- Usage: YAML config plugin -->
+1 -1
View File
@@ -218,7 +218,7 @@ var/received_health_check = FALSE
/datum/tgs_chat_command/response_overload_test/Run(datum/tgs_chat_user/sender, params)
// DMAPI5_TOPIC_RESPONSE_LIMIT
var/limit = 65528
var/limit = 65529
// this actually gets doubled because it's in two fields for backwards compatibility, but that's fine
var/datum/tgs_message_content/response = new(create_payload(limit * 3))
return response
@@ -562,7 +562,7 @@ namespace Tgstation.Server.Tests.Live.Instance
try
{
System.Console.WriteLine($"Topic send limit test S:{currentSize}...");
topicRequestResult = await TopicClientNoLogger.SendTopic(
topicRequestResult = await TopicClient.SendTopic(
IPAddress.Loopback,
$"tgs_integration_test_tactics3={TopicClient.SanitizeString(JsonConvert.SerializeObject(topic, DMApiConstants.SerializerSettings))}",
TestLiveServer.DDPort,
@@ -603,7 +603,7 @@ namespace Tgstation.Server.Tests.Live.Instance
{
var currentSize = baseSize + (int)Math.Pow(2, nextPow);
System.Console.WriteLine($"Topic recieve limit test S:{currentSize}...");
var topicRequestResult = await TopicClientNoLogger.SendTopic(
var topicRequestResult = await TopicClient.SendTopic(
IPAddress.Loopback,
$"tgs_integration_test_tactics4={TopicClient.SanitizeString(currentSize.ToString())}",
TestLiveServer.DDPort,
@@ -956,15 +956,7 @@ namespace Tgstation.Server.Tests.Live.Instance
ReceiveTimeout = TimeSpan.FromSeconds(30),
ConnectTimeout = TimeSpan.FromSeconds(30),
DisconnectTimeout = TimeSpan.FromSeconds(30)
}, new Logger<TopicClient>(LiveTestUtils.CreateLoggerFactoryForLogger(loggerFactory.CreateLogger("WatchdogTest.TopicClient"), out var mockLoggerFactory)));
public static readonly TopicClient TopicClientNoLogger = new(new SocketParameters
{
SendTimeout = TimeSpan.FromSeconds(30),
ReceiveTimeout = TimeSpan.FromSeconds(30),
ConnectTimeout = TimeSpan.FromSeconds(30),
DisconnectTimeout = TimeSpan.FromSeconds(30)
});
}, loggerFactory.CreateLogger("WatchdogTest.TopicClient"));
public async Task<DreamDaemonResponse> TellWorldToReboot(CancellationToken cancellationToken)
{