Codechange: move logic whether there is enough space in a packet to write data into the Packet
This commit is contained in:
@@ -613,7 +613,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCmdNames()
|
||||
/* Should SEND_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->size + strlen(cmdname) + 5 >= SEND_MTU) {
|
||||
if (p->CanWriteToPacket(strlen(cmdname) + 5)) {
|
||||
p->Send_bool(false);
|
||||
this->SendPacket(p);
|
||||
|
||||
|
Reference in New Issue
Block a user