]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Bug fix for DnD performance tuning for Mac and Windows clients; not
authorOliver Kurth <okurth@vmware.com>
Thu, 28 Mar 2019 19:43:00 +0000 (12:43 -0700)
committerOliver Kurth <okurth@vmware.com>
Thu, 28 Mar 2019 19:43:00 +0000 (12:43 -0700)
directly applicable to open-vm-tools.

open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.c
open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h
open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp

index e146e5141057a7d1f457139183ab5c53406679be..1c6acb68a557614643a083e2edf35b0784655dc8 100644 (file)
@@ -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;
    }
 
index 5d3ef7826ca03d73593b14ca2581565ad9989fa7..556e592c93f176a816bf35192fb8c4cbbc1e73d6 100644 (file)
@@ -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);
index cca5d9ed7fef62ff3b05e1636f41763499a65009..4c9ce9f6f6d63775fbd6c453766e84f04a27de12 100644 (file)
@@ -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) {