Added client bandwidth measurement result callback.
This commit is contained in:
parent
1810656199
commit
e239c10fb9
@ -29,6 +29,7 @@ typedef BOOL (*pBandwidthMeasureStart)(rdpContext* context, UINT16 sequenceNumbe
|
|||||||
typedef BOOL (*pBandwidthMeasureStop)(rdpContext* context, UINT16 sequenceNumber);
|
typedef BOOL (*pBandwidthMeasureStop)(rdpContext* context, UINT16 sequenceNumber);
|
||||||
typedef BOOL (*pBandwidthMeasureResults)(rdpContext* context, UINT16 sequenceNumber);
|
typedef BOOL (*pBandwidthMeasureResults)(rdpContext* context, UINT16 sequenceNumber);
|
||||||
typedef BOOL (*pNetworkCharacteristicsResult)(rdpContext* context, UINT16 sequenceNumber);
|
typedef BOOL (*pNetworkCharacteristicsResult)(rdpContext* context, UINT16 sequenceNumber);
|
||||||
|
typedef BOOL (*pClientBandwidthMeasureResult)(rdpContext* context, rdpAutoDetect* data);
|
||||||
|
|
||||||
struct rdp_autodetect
|
struct rdp_autodetect
|
||||||
{
|
{
|
||||||
@ -52,7 +53,8 @@ struct rdp_autodetect
|
|||||||
ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop; /* 19 */
|
ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop; /* 19 */
|
||||||
ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults; /* 20 */
|
ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults; /* 20 */
|
||||||
ALIGN64 pNetworkCharacteristicsResult NetworkCharacteristicsResult; /* 21 */
|
ALIGN64 pNetworkCharacteristicsResult NetworkCharacteristicsResult; /* 21 */
|
||||||
UINT64 paddingB[32 - 22]; /* 22 */
|
ALIGN64 pClientBandwidthMeasureResult ClientBandwidthMeasureResult; /* 22 */
|
||||||
|
UINT64 paddingB[32 - 23]; /* 23 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -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)
|
static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 responseType, UINT16 sequenceNumber)
|
||||||
{
|
{
|
||||||
|
BOOL success = TRUE;
|
||||||
wStream* s;
|
wStream* s;
|
||||||
UINT32 timeDelta;
|
UINT32 timeDelta;
|
||||||
|
|
||||||
/* Compute the total time */
|
/* Compute the total time */
|
||||||
timeDelta = GetTickCount() - rdp->autodetect->bandwidthMeasureStartTime;
|
timeDelta = GetTickCount() - rdp->autodetect->bandwidthMeasureStartTime;
|
||||||
|
|
||||||
/* Send the result PDU to the server */
|
/* Send the result PDU to the server */
|
||||||
|
|
||||||
s = rdp_message_channel_pdu_init(rdp);
|
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, timeDelta); /* timeDelta (4 bytes) */
|
||||||
Stream_Write_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (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);
|
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)
|
BOOL autodetect_send_netchar_sync(rdpRdp* rdp, UINT16 sequenceNumber)
|
||||||
{
|
{
|
||||||
wStream* s;
|
wStream* s;
|
||||||
|
|
||||||
/* Send the response PDU to the server */
|
/* Send the response PDU to the server */
|
||||||
|
|
||||||
s = rdp_message_channel_pdu_init(rdp);
|
s = rdp_message_channel_pdu_init(rdp);
|
||||||
|
Loading…
Reference in New Issue
Block a user