summaryrefslogtreecommitdiff
path: root/src/network/network_udp.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_udp.cpp
parent8b302761d4ca51f41eaff4097c9afa4f3aec5ec5 (diff)
downloadopenttd-d6000c2ec5f61c599d8859b981f2dac6a92e0755.tar.xz
Codechange: differentiate between UDP, TCP and compatibility MTU values
Diffstat (limited to 'src/network/network_udp.cpp')
-rw-r--r--src/network/network_udp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index aa34515bd..f7db689d4 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -256,10 +256,10 @@ void ServerNetworkUDPSocketHandler::Receive_CLIENT_DETAIL_INFO(Packet *p, Networ
/**
* A client has requested the names of some NewGRFs.
*
- * Replying this can be tricky as we have a limit of SEND_MTU bytes
+ * Replying this can be tricky as we have a limit of UDP_MTU bytes
* in the reply packet and we can send up to 100 bytes per NewGRF
* (GRF ID, MD5sum and NETWORK_GRF_NAME_LENGTH bytes for the name).
- * As SEND_MTU is _much_ less than 100 * NETWORK_MAX_GRF_COUNT, it
+ * As UDP_MTU is _much_ less than 100 * NETWORK_MAX_GRF_COUNT, it
* could be that a packet overflows. To stop this we only reply
* with the first N NewGRFs so that if the first N + 1 NewGRFs
* would be sent, the packet overflows.
@@ -295,7 +295,7 @@ void ServerNetworkUDPSocketHandler::Receive_CLIENT_GET_NEWGRFS(Packet *p, Networ
* The name could be an empty string, if so take the filename. */
packet_len += sizeof(c.grfid) + sizeof(c.md5sum) +
std::min(strlen(f->GetName()) + 1, (size_t)NETWORK_GRF_NAME_LENGTH);
- if (packet_len > SEND_MTU - 4) { // 4 is 3 byte header + grf count in reply
+ if (packet_len > UDP_MTU - 4) { // 4 is 3 byte header + grf count in reply
break;
}
in_reply[in_reply_count] = f;