ALIGN64 UINT32 netCharBandwidth; /* 5 */
ALIGN64 UINT32 netCharBaseRTT; /* 6 */
ALIGN64 UINT32 netCharAverageRTT; /* 7 */
- UINT64 paddingA[16 - 8]; /* 8 */
+ ALIGN64 BOOL bandwidthMeasureStarted; /* 8 */
+ UINT64 paddingA[16 - 9]; /* 9 */
ALIGN64 pRTTMeasureRequest RTTMeasureRequest; /* 16 */
ALIGN64 pRTTMeasureResponse RTTMeasureResponse; /* 17 */
rdp->autodetect->bandwidthMeasureStartTime = GetTickCount();
rdp->autodetect->bandwidthMeasureByteCount = 0;
+ /* Continuous Auto-Detection: mark the start of the measurement */
+ if (autodetectReqPdu->requestType == 0x0014)
+ {
+ rdp->autodetect->bandwidthMeasureStarted = TRUE;
+ }
+
return TRUE;
}
/* Add the payload length to the bandwidth measurement parameters */
rdp->autodetect->bandwidthMeasureByteCount += payloadLength;
+ /* Continuous Auto-Detection: mark the stop of the measurement */
+ if (autodetectReqPdu->requestType == 0x0429)
+ {
+ rdp->autodetect->bandwidthMeasureStarted = FALSE;
+ }
+
/* Send a response the server */
responseType = autodetectReqPdu->requestType == 0x002B ? 0x0003 : 0x000B;
if (rdp->disconnect)
return 0;
+ if (rdp->autodetect->bandwidthMeasureStarted)
+ {
+ rdp->autodetect->bandwidthMeasureByteCount += length;
+ }
+
if (rdp->settings->DisableEncryption)
{
if (!rdp_read_security_header(s, &securityFlags))
return -1;
}
+ if (rdp->autodetect->bandwidthMeasureStarted)
+ {
+ rdp->autodetect->bandwidthMeasureByteCount += length;
+ }
+
if (fastpath->encryptionFlags & FASTPATH_OUTPUT_ENCRYPTED)
{
UINT16 flags = (fastpath->encryptionFlags & FASTPATH_OUTPUT_SECURE_CHECKSUM) ? SEC_SECURE_CHECKSUM : 0;