summaryrefslogtreecommitdiff
path: root/src/network/network_admin.cpp
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-04-18 14:49:39 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-04-25 21:27:54 +0200
commitd6000c2ec5f61c599d8859b981f2dac6a92e0755 (patch)
tree41418504a0c6e9701295228873bfc2c6d66fe313 /src/network/network_admin.cpp
parent8b302761d4ca51f41eaff4097c9afa4f3aec5ec5 (diff)
downloadopenttd-d6000c2ec5f61c599d8859b981f2dac6a92e0755.tar.xz
Codechange: differentiate between UDP, TCP and compatibility MTU values
Diffstat (limited to 'src/network/network_admin.cpp')
-rw-r--r--src/network/network_admin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp
index 057ad5988..1b86c3e56 100644
--- a/src/network/network_admin.cpp
+++ b/src/network/network_admin.cpp
@@ -560,8 +560,8 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendConsole(const char *origi
/* If the length of both strings, plus the 2 '\0' terminations and 3 bytes of the packet
* are bigger than the MTU, just ignore the message. Better safe than sorry. It should
* never occur though as the longest strings are chat messages, which are still 30%
- * smaller than SEND_MTU. */
- if (strlen(origin) + strlen(string) + 2 + 3 >= SEND_MTU) return NETWORK_RECV_STATUS_OKAY;
+ * smaller than COMPAT_MTU. */
+ if (strlen(origin) + strlen(string) + 2 + 3 >= COMPAT_MTU) return NETWORK_RECV_STATUS_OKAY;
Packet *p = new Packet(ADMIN_PACKET_SERVER_CONSOLE);
@@ -610,7 +610,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCmdNames()
for (uint i = 0; i < CMD_END; i++) {
const char *cmdname = GetCommandName(i);
- /* Should SEND_MTU be exceeded, start a new packet
+ /* Should COMPAT_MTU be exceeded, start a new packet
* (magic 5: 1 bool "more data" and one uint16 "command id", one
* byte for string '\0' termination and 1 bool "no more data" */
if (p->CanWriteToPacket(strlen(cmdname) + 5)) {