diff --git a/include/freerdp/autodetect.h b/include/freerdp/autodetect.h index 3f69f9254..d5fa2e7fc 100644 --- a/include/freerdp/autodetect.h +++ b/include/freerdp/autodetect.h @@ -29,6 +29,7 @@ typedef BOOL (*pBandwidthMeasureStart)(rdpContext* context, UINT16 sequenceNumbe typedef BOOL (*pBandwidthMeasureStop)(rdpContext* context, UINT16 sequenceNumber); typedef BOOL (*pBandwidthMeasureResults)(rdpContext* context, UINT16 sequenceNumber); typedef BOOL (*pNetworkCharacteristicsResult)(rdpContext* context, UINT16 sequenceNumber); +typedef BOOL (*pClientBandwidthMeasureResult)(rdpContext* context, rdpAutoDetect* data); struct rdp_autodetect { @@ -52,7 +53,8 @@ struct rdp_autodetect ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop; /* 19 */ ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults; /* 20 */ ALIGN64 pNetworkCharacteristicsResult NetworkCharacteristicsResult; /* 21 */ - UINT64 paddingB[32 - 22]; /* 22 */ + ALIGN64 pClientBandwidthMeasureResult ClientBandwidthMeasureResult; /* 22 */ + UINT64 paddingB[32 - 23]; /* 23 */ }; diff --git a/libfreerdp/core/autodetect.c b/libfreerdp/core/autodetect.c index 677aa1412..cc06ebc6b 100644 --- a/libfreerdp/core/autodetect.c +++ b/libfreerdp/core/autodetect.c @@ -224,12 +224,13 @@ BOOL autodetect_send_connecttime_bandwidth_measure_stop(rdpContext* context, UIN static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 responseType, UINT16 sequenceNumber) { + BOOL success = TRUE; wStream* s; UINT32 timeDelta; - + /* Compute the total time */ timeDelta = GetTickCount() - rdp->autodetect->bandwidthMeasureStartTime; - + /* Send the result PDU to the server */ s = rdp_message_channel_pdu_init(rdp); @@ -246,6 +247,12 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 respon Stream_Write_UINT32(s, timeDelta); /* timeDelta (4 bytes) */ Stream_Write_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (4 bytes) */ + IFCALLRET(rdp->autodetect->ClientBandwidthMeasureResult, success, + rdp->context, rdp->autodetect); + + if (!success) + return FALSE; + return rdp_send_message_channel_pdu(rdp, s, SEC_AUTODETECT_RSP); } @@ -286,7 +293,7 @@ static BOOL autodetect_send_netchar_result(rdpContext* context, UINT16 sequenceN BOOL autodetect_send_netchar_sync(rdpRdp* rdp, UINT16 sequenceNumber) { wStream* s; - + /* Send the response PDU to the server */ s = rdp_message_channel_pdu_init(rdp);