From: Oliver Kurth Date: Thu, 28 Mar 2019 19:43:00 +0000 (-0700) Subject: Bug fix for DnD performance tuning for Mac and Windows clients; not X-Git-Tag: stable-11.0.0~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59a7e9e1c5e8e6883740ec43371cbe7076ee6bc0;p=thirdparty%2Fopen-vm-tools.git Bug fix for DnD performance tuning for Mac and Windows clients; not directly applicable to open-vm-tools. --- diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.c b/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.c index e146e5141..1c6acb68a 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.c +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.c @@ -122,12 +122,14 @@ DnDCPMsgV4_Destroy(DnDCPMsgV4 *msg) * * @param[in] packet * @param[in] packetSize + * @param[in] allowed max packet Size * * @return DnDCPMsgPacketType */ DnDCPMsgPacketType DnDCPMsgV4_GetPacketType(const uint8 *packet, - size_t packetSize) + size_t packetSize, + const uint32 maxPacketPayloadSize) { DnDCPMsgHdrV4 *msgHdr = NULL; ASSERT(packet); @@ -137,7 +139,7 @@ DnDCPMsgPacketType DnDCPMsgV4_GetPacketType(const uint8 *packet, } msgHdr = (DnDCPMsgHdrV4 *)packet; - if (msgHdr->binarySize <= DND_CP_PACKET_MAX_PAYLOAD_SIZE_V4) { + if (msgHdr->binarySize <= maxPacketPayloadSize) { return DND_CP_MSG_PACKET_TYPE_SINGLE; } diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h b/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h index 5d3ef7826..556e592c9 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h @@ -240,7 +240,8 @@ typedef struct DnDCPMsgV4 { void DnDCPMsgV4_Init(DnDCPMsgV4 *msg); void DnDCPMsgV4_Destroy(DnDCPMsgV4 *msg); DnDCPMsgPacketType DnDCPMsgV4_GetPacketType(const uint8 *packet, - size_t packetSize); + size_t packetSize, + const uint32 maxPacketPayloadSize); Bool DnDCPMsgV4_Serialize(DnDCPMsgV4 *msg, uint8 **packet, size_t *packetSize); diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp index cca5d9ed7..4c9ce9f6f 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp @@ -369,7 +369,7 @@ RpcV4Util::OnRecvPacket(uint32 srcId, DnDCPMsgPacketType packetType = DND_CP_MSG_PACKET_TYPE_INVALID; if (packetSize <= mMaxTransportPacketPayloadSize + DND_CP_MSG_HEADERSIZE_V4) { - packetType = DnDCPMsgV4_GetPacketType(packet, packetSize); + packetType = DnDCPMsgV4_GetPacketType(packet, packetSize, mMaxTransportPacketPayloadSize); } switch (packetType) {