зеркало из https://github.com/microsoft/msquic.git
QUIC_STATISTICS_V2 (#2386)
This commit is contained in:
Родитель
61a039d72e
Коммит
82c823adc0
|
@ -142,6 +142,8 @@ These parameters are accessed by calling [GetParam](./api/GetParam.md) or [SetPa
|
|||
| `QUIC_PARAM_CONN_TLS_SECRETS`<br> 19 | QUIC_TLS_SECRETS | Set-only | The TLS secrets struct to be populated by MsQuic. |
|
||||
| `QUIC_PARAM_CONN_DESIRED_VERSIONS`<br> 20 | uint8_t[] | Get-only | The desired QUIC versions for the connection. |
|
||||
| `QUIC_PARAM_CONN_INITIAL_DCID_PREFIX`<br> 21 | uint8_t[] | Set-only | CID prefix prepended to initial destination CID. |
|
||||
| `QUIC_PARAM_CONN_STATISTICS_V2`<br> 5 | QUIC_STATISTICS_V2 | Get-only | Connection-level statistics, version 2. |
|
||||
| `QUIC_PARAM_CONN_STATISTICS_V2_PLAT`<br> 6 | QUIC_STATISTICS_V2 | Get-only | Connection-level statistics with platform-specific time format, version 2. |
|
||||
|
||||
### TLS Parameters
|
||||
|
||||
|
|
|
@ -6635,6 +6635,67 @@ QuicConnParamGet(
|
|||
Status = QUIC_STATUS_SUCCESS;
|
||||
break;
|
||||
|
||||
case QUIC_PARAM_CONN_STATISTICS_V2:
|
||||
case QUIC_PARAM_CONN_STATISTICS_V2_PLAT: {
|
||||
|
||||
if (*BufferLength < sizeof(QUIC_STATISTICS_V2)) {
|
||||
*BufferLength = sizeof(QUIC_STATISTICS_V2);
|
||||
Status = QUIC_STATUS_BUFFER_TOO_SMALL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Buffer == NULL) {
|
||||
Status = QUIC_STATUS_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
QUIC_STATISTICS_V2* Stats = (QUIC_STATISTICS_V2*)Buffer;
|
||||
const QUIC_PATH* Path = &Connection->Paths[0];
|
||||
|
||||
Stats->CorrelationId = Connection->Stats.CorrelationId;
|
||||
Stats->VersionNegotiation = Connection->Stats.VersionNegotiation;
|
||||
Stats->StatelessRetry = Connection->Stats.StatelessRetry;
|
||||
Stats->ResumptionAttempted = Connection->Stats.ResumptionAttempted;
|
||||
Stats->ResumptionSucceeded = Connection->Stats.ResumptionSucceeded;
|
||||
Stats->Rtt = Path->SmoothedRtt;
|
||||
Stats->MinRtt = Path->MinRtt;
|
||||
Stats->MaxRtt = Path->MaxRtt;
|
||||
Stats->TimingStart = Connection->Stats.Timing.Start;
|
||||
Stats->TimingInitialFlightEnd = Connection->Stats.Timing.InitialFlightEnd;
|
||||
Stats->TimingHandshakeFlightEnd = Connection->Stats.Timing.HandshakeFlightEnd;
|
||||
Stats->HandshakeClientFlight1Bytes = Connection->Stats.Handshake.ClientFlight1Bytes;
|
||||
Stats->HandshakeServerFlight1Bytes = Connection->Stats.Handshake.ServerFlight1Bytes;
|
||||
Stats->HandshakeClientFlight2Bytes = Connection->Stats.Handshake.ClientFlight2Bytes;
|
||||
Stats->SendPathMtu = Path->Mtu;
|
||||
Stats->SendTotalPackets = Connection->Stats.Send.TotalPackets;
|
||||
Stats->SendRetransmittablePackets = Connection->Stats.Send.RetransmittablePackets;
|
||||
Stats->SendSuspectedLostPackets = Connection->Stats.Send.SuspectedLostPackets;
|
||||
Stats->SendSpuriousLostPackets = Connection->Stats.Send.SpuriousLostPackets;
|
||||
Stats->SendTotalBytes = Connection->Stats.Send.TotalBytes;
|
||||
Stats->SendTotalStreamBytes = Connection->Stats.Send.TotalStreamBytes;
|
||||
Stats->SendCongestionCount = Connection->Stats.Send.CongestionCount;
|
||||
Stats->SendPersistentCongestionCount = Connection->Stats.Send.PersistentCongestionCount;
|
||||
Stats->RecvTotalPackets = Connection->Stats.Recv.TotalPackets;
|
||||
Stats->RecvReorderedPackets = Connection->Stats.Recv.ReorderedPackets;
|
||||
Stats->RecvDroppedPackets = Connection->Stats.Recv.DroppedPackets;
|
||||
Stats->RecvDuplicatePackets = Connection->Stats.Recv.DuplicatePackets;
|
||||
Stats->RecvTotalBytes = Connection->Stats.Recv.TotalBytes;
|
||||
Stats->RecvTotalStreamBytes = Connection->Stats.Recv.TotalStreamBytes;
|
||||
Stats->RecvDecryptionFailures = Connection->Stats.Recv.DecryptionFailures;
|
||||
Stats->RecvValidAckFrames = Connection->Stats.Recv.ValidAckFrames;
|
||||
Stats->KeyUpdateCount = Connection->Stats.Misc.KeyUpdateCount;
|
||||
|
||||
if (Param == QUIC_PARAM_CONN_STATISTICS_PLAT) {
|
||||
Stats->TimingStart = CxPlatTimeUs64ToPlat(Stats->TimingStart); // cppcheck-suppress selfAssignment
|
||||
Stats->TimingInitialFlightEnd = CxPlatTimeUs64ToPlat(Stats->TimingInitialFlightEnd); // cppcheck-suppress selfAssignment
|
||||
Stats->TimingHandshakeFlightEnd = CxPlatTimeUs64ToPlat(Stats->TimingHandshakeFlightEnd); // cppcheck-suppress selfAssignment
|
||||
}
|
||||
|
||||
*BufferLength = sizeof(QUIC_STATISTICS);
|
||||
Status = QUIC_STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
Status = QUIC_STATUS_INVALID_PARAMETER;
|
||||
break;
|
||||
|
|
|
@ -767,9 +767,9 @@ QuicListenerParamGet(
|
|||
Stats->TotalRejectedConnections = Listener->TotalRejectedConnections;
|
||||
|
||||
if (Listener->Binding != NULL) {
|
||||
Stats->Binding.Recv.DroppedPackets = Listener->Binding->Stats.Recv.DroppedPackets;
|
||||
Stats->BindingRecvDroppedPackets = Listener->Binding->Stats.Recv.DroppedPackets;
|
||||
} else {
|
||||
Stats->Binding.Recv.DroppedPackets = 0;
|
||||
Stats->BindingRecvDroppedPackets = 0;
|
||||
}
|
||||
|
||||
Status = QUIC_STATUS_SUCCESS;
|
||||
|
|
|
@ -2249,6 +2249,12 @@ namespace Microsoft.Quic
|
|||
[NativeTypeName("#define QUIC_PARAM_CONN_INITIAL_DCID_PREFIX 0x14000015")]
|
||||
public const int QUIC_PARAM_CONN_INITIAL_DCID_PREFIX = 0x14000015;
|
||||
|
||||
[NativeTypeName("#define QUIC_PARAM_CONN_STATISTICS_V2 0x05000016")]
|
||||
public const int QUIC_PARAM_CONN_STATISTICS_V2 = 0x05000016;
|
||||
|
||||
[NativeTypeName("#define QUIC_PARAM_CONN_STATISTICS_V2_PLAT 0x05000017")]
|
||||
public const int QUIC_PARAM_CONN_STATISTICS_V2_PLAT = 0x05000017;
|
||||
|
||||
[NativeTypeName("#define QUIC_PARAM_TLS_HANDSHAKE_INFO 0x06000000")]
|
||||
public const int QUIC_PARAM_TLS_HANDSHAKE_INFO = 0x06000000;
|
||||
|
||||
|
|
|
@ -429,16 +429,57 @@ typedef struct QUIC_STATISTICS {
|
|||
} Misc;
|
||||
} QUIC_STATISTICS;
|
||||
|
||||
typedef struct QUIC_STATISTICS_V2 {
|
||||
|
||||
uint64_t CorrelationId;
|
||||
uint32_t VersionNegotiation : 1;
|
||||
uint32_t StatelessRetry : 1;
|
||||
uint32_t ResumptionAttempted : 1;
|
||||
uint32_t ResumptionSucceeded : 1;
|
||||
uint32_t Rtt; // In microseconds
|
||||
uint32_t MinRtt; // In microseconds
|
||||
uint32_t MaxRtt; // In microseconds
|
||||
|
||||
uint64_t TimingStart;
|
||||
uint64_t TimingInitialFlightEnd; // Processed all peer's Initial packets
|
||||
uint64_t TimingHandshakeFlightEnd; // Processed all peer's Handshake packets
|
||||
|
||||
uint32_t HandshakeClientFlight1Bytes; // Sum of TLS payloads
|
||||
uint32_t HandshakeServerFlight1Bytes; // Sum of TLS payloads
|
||||
uint32_t HandshakeClientFlight2Bytes; // Sum of TLS payloads
|
||||
|
||||
uint16_t SendPathMtu; // Current path MTU.
|
||||
uint64_t SendTotalPackets; // QUIC packets; could be coalesced into fewer UDP datagrams.
|
||||
uint64_t SendRetransmittablePackets;
|
||||
uint64_t SendSuspectedLostPackets;
|
||||
uint64_t SendSpuriousLostPackets; // Actual lost is (SuspectedLostPackets - SpuriousLostPackets)
|
||||
uint64_t SendTotalBytes; // Sum of UDP payloads
|
||||
uint64_t SendTotalStreamBytes; // Sum of stream payloads
|
||||
uint32_t SendCongestionCount; // Number of congestion events
|
||||
uint32_t SendPersistentCongestionCount; // Number of persistent congestion events
|
||||
|
||||
uint64_t RecvTotalPackets; // QUIC packets; could be coalesced into fewer UDP datagrams.
|
||||
uint64_t RecvReorderedPackets; // Packets where packet number is less than highest seen.
|
||||
uint64_t RecvDroppedPackets; // Includes DuplicatePackets.
|
||||
uint64_t RecvDuplicatePackets;
|
||||
uint64_t RecvTotalBytes; // Sum of UDP payloads
|
||||
uint64_t RecvTotalStreamBytes; // Sum of stream payloads
|
||||
uint64_t RecvDecryptionFailures; // Count of packet decryption failures.
|
||||
uint64_t RecvValidAckFrames; // Count of receive ACK frames.
|
||||
|
||||
uint32_t KeyUpdateCount;
|
||||
|
||||
// N.B. New fields must be appended to end
|
||||
|
||||
} QUIC_STATISTICS_V2;
|
||||
|
||||
typedef struct QUIC_LISTENER_STATISTICS {
|
||||
|
||||
uint64_t TotalAcceptedConnections;
|
||||
uint64_t TotalRejectedConnections;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
uint64_t DroppedPackets;
|
||||
} Recv;
|
||||
} Binding;
|
||||
uint64_t BindingRecvDroppedPackets;
|
||||
|
||||
} QUIC_LISTENER_STATISTICS;
|
||||
|
||||
typedef enum QUIC_PERFORMANCE_COUNTERS {
|
||||
|
@ -702,6 +743,8 @@ typedef enum QUIC_PARAM_LEVEL {
|
|||
#define QUIC_PARAM_CONN_TLS_SECRETS 0x05000013 // QUIC_TLS_SECRETS (SSLKEYLOGFILE compatible)
|
||||
#define QUIC_PARAM_CONN_DESIRED_VERSIONS 0x05000014 // uint32_t[]
|
||||
#define QUIC_PARAM_CONN_INITIAL_DCID_PREFIX 0x05000015 // bytes[]
|
||||
#define QUIC_PARAM_CONN_STATISTICS_V2 0x05000016 // QUIC_STATISTICS_V2
|
||||
#define QUIC_PARAM_CONN_STATISTICS_V2_PLAT 0x05000017 // QUIC_STATISTICS_V2
|
||||
|
||||
//
|
||||
// Parameters for TLS.
|
||||
|
|
|
@ -888,12 +888,12 @@ struct MsQuicConnection {
|
|||
}
|
||||
|
||||
QUIC_STATUS
|
||||
GetStatistics(_Out_ QUIC_STATISTICS* Statistics) const noexcept {
|
||||
GetStatistics(_Out_ QUIC_STATISTICS_V2* Statistics) const noexcept {
|
||||
uint32_t Size = sizeof(*Statistics);
|
||||
return
|
||||
MsQuic->GetParam(
|
||||
Handle,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&Size,
|
||||
Statistics);
|
||||
}
|
||||
|
|
|
@ -580,6 +580,8 @@ pub const PARAM_CONN_LOCAL_INTERFACE: u32 = 0x05000012;
|
|||
pub const PARAM_CONN_TLS_SECRETS: u32 = 0x05000013;
|
||||
pub const PARAM_CONN_DESIRED_VERSIONS: u32 = 0x05000014;
|
||||
pub const PARAM_CONN_INITIAL_DCID_PREFIX: u32 = 0x05000015;
|
||||
pub const PARAM_CONN_STATISTICS_V2: u32 = 0x05000016;
|
||||
pub const PARAM_CONN_STATISTICS_V2_PLAT: u32 = 0x05000017;
|
||||
|
||||
pub const PARAM_TLS_HANDSHAKE_INFO: u32 = 0x06000000;
|
||||
pub const PARAM_TLS_NEGOTIATED_ALPN: u32 = 0x06000001;
|
||||
|
|
|
@ -324,24 +324,24 @@ QuicPrintConnectionStatistics(
|
|||
_In_ HQUIC Connection
|
||||
)
|
||||
{
|
||||
QUIC_STATISTICS Statistics;
|
||||
QUIC_STATISTICS_V2 Statistics;
|
||||
uint32_t StatsSize = sizeof(Statistics);
|
||||
if (QUIC_SUCCEEDED(
|
||||
ApiTable->GetParam(
|
||||
Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Statistics))) {
|
||||
WriteOutput(
|
||||
"[conn][%p] STATS: SendTotalPackets=%llu SendSuspectedLostPackets=%llu SendSpuriousLostPackets=%llu RecvTotalPackets=%llu RecvReorderedPackets=%llu RecvDroppedPackets=%llu RecvDuplicatePackets=%llu RecvDecryptionFailures=%llu\n",
|
||||
Connection,
|
||||
(unsigned long long)Statistics.Send.TotalPackets,
|
||||
(unsigned long long)Statistics.Send.SuspectedLostPackets,
|
||||
(unsigned long long)Statistics.Send.SpuriousLostPackets,
|
||||
(unsigned long long)Statistics.Recv.TotalPackets,
|
||||
(unsigned long long)Statistics.Recv.ReorderedPackets,
|
||||
(unsigned long long)Statistics.Recv.DroppedPackets,
|
||||
(unsigned long long)Statistics.Recv.DuplicatePackets,
|
||||
(unsigned long long)Statistics.Recv.DecryptionFailures);
|
||||
(unsigned long long)Statistics.SendTotalPackets,
|
||||
(unsigned long long)Statistics.SendSuspectedLostPackets,
|
||||
(unsigned long long)Statistics.SendSpuriousLostPackets,
|
||||
(unsigned long long)Statistics.RecvTotalPackets,
|
||||
(unsigned long long)Statistics.RecvReorderedPackets,
|
||||
(unsigned long long)Statistics.RecvDroppedPackets,
|
||||
(unsigned long long)Statistics.RecvDuplicatePackets,
|
||||
(unsigned long long)Statistics.RecvDecryptionFailures);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1833,18 +1833,18 @@ QuicAckDelayStreamHandler(
|
|||
//
|
||||
switch (Event->Type) {
|
||||
case QUIC_STREAM_EVENT_RECEIVE: {
|
||||
QUIC_STATISTICS Stats{};
|
||||
QUIC_STATISTICS_V2 Stats{};
|
||||
uint32_t StatsSize = sizeof(Stats);
|
||||
Status = MsQuic->GetParam(
|
||||
TestContext->ClientConnection.Handle,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
if (QUIC_FAILED(Status)) {
|
||||
TEST_FAILURE("Client failed to query statistics on receive 0x%x", Status);
|
||||
return Status;
|
||||
}
|
||||
TestContext->AckCountStop = Stats.Recv.ValidAckFrames;
|
||||
TestContext->AckCountStop = Stats.RecvValidAckFrames;
|
||||
Event->RECEIVE.TotalBufferLength = 0;
|
||||
CxPlatEventSet(TestContext->ClientReceiveDataEvent.Handle);
|
||||
break;
|
||||
|
@ -2012,19 +2012,19 @@ QuicTestAckSendDelay(
|
|||
//
|
||||
CxPlatSleep(100);
|
||||
|
||||
QUIC_STATISTICS Stats{};
|
||||
QUIC_STATISTICS_V2 Stats{};
|
||||
uint32_t StatsSize = sizeof(Stats);
|
||||
Status =
|
||||
MsQuic->GetParam(
|
||||
TestContext.ClientConnection.Handle,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
if (QUIC_FAILED(Status)) {
|
||||
TEST_FAILURE("Client failed to query statistics at start 0x%x", Status);
|
||||
return;
|
||||
}
|
||||
TestContext.AckCountStart = Stats.Recv.ValidAckFrames;
|
||||
TestContext.AckCountStart = Stats.RecvValidAckFrames;
|
||||
Status =
|
||||
MsQuic->StreamOpen(
|
||||
TestContext.ClientConnection.Handle,
|
||||
|
|
|
@ -1847,25 +1847,25 @@ QuicTestKeyUpdateRandomLoss(
|
|||
CxPlatSleep(100);
|
||||
}
|
||||
|
||||
QUIC_STATISTICS Stats = Client.GetStatistics();
|
||||
if (Stats.Recv.DecryptionFailures) {
|
||||
TEST_FAILURE("%llu server packets failed to decrypt!", Stats.Recv.DecryptionFailures);
|
||||
QUIC_STATISTICS_V2 Stats = Client.GetStatistics();
|
||||
if (Stats.RecvDecryptionFailures) {
|
||||
TEST_FAILURE("%llu server packets failed to decrypt!", Stats.RecvDecryptionFailures);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Stats.Misc.KeyUpdateCount < 1) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected at least 1", Stats.Misc.KeyUpdateCount);
|
||||
if (Stats.KeyUpdateCount < 1) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected at least 1", Stats.KeyUpdateCount);
|
||||
return;
|
||||
}
|
||||
|
||||
Stats = Server->GetStatistics();
|
||||
if (Stats.Recv.DecryptionFailures) {
|
||||
TEST_FAILURE("%llu client packets failed to decrypt!", Stats.Recv.DecryptionFailures);
|
||||
if (Stats.RecvDecryptionFailures) {
|
||||
TEST_FAILURE("%llu client packets failed to decrypt!", Stats.RecvDecryptionFailures);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Stats.Misc.KeyUpdateCount < 1) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected at least 1", Stats.Misc.KeyUpdateCount);
|
||||
if (Stats.KeyUpdateCount < 1) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected at least 1", Stats.KeyUpdateCount);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1978,27 +1978,27 @@ QuicTestKeyUpdate(
|
|||
|
||||
CxPlatSleep(100);
|
||||
|
||||
QUIC_STATISTICS Stats = Client.GetStatistics();
|
||||
if (Stats.Recv.DecryptionFailures) {
|
||||
TEST_FAILURE("%llu server packets failed to decrypt!", Stats.Recv.DecryptionFailures);
|
||||
QUIC_STATISTICS_V2 Stats = Client.GetStatistics();
|
||||
if (Stats.RecvDecryptionFailures) {
|
||||
TEST_FAILURE("%llu server packets failed to decrypt!", Stats.RecvDecryptionFailures);
|
||||
return;
|
||||
}
|
||||
|
||||
uint16_t ExpectedUpdates = Iterations - (UseKeyUpdateBytes ? 1u : 0u);
|
||||
|
||||
if (Stats.Misc.KeyUpdateCount < ExpectedUpdates) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected %d", Stats.Misc.KeyUpdateCount, ExpectedUpdates);
|
||||
if (Stats.KeyUpdateCount < ExpectedUpdates) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected %d", Stats.KeyUpdateCount, ExpectedUpdates);
|
||||
return;
|
||||
}
|
||||
|
||||
Stats = Server->GetStatistics();
|
||||
if (Stats.Recv.DecryptionFailures) {
|
||||
TEST_FAILURE("%llu client packets failed to decrypt!", Stats.Recv.DecryptionFailures);
|
||||
if (Stats.RecvDecryptionFailures) {
|
||||
TEST_FAILURE("%llu client packets failed to decrypt!", Stats.RecvDecryptionFailures);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Stats.Misc.KeyUpdateCount < ExpectedUpdates) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected %d", Stats.Misc.KeyUpdateCount, ExpectedUpdates);
|
||||
if (Stats.KeyUpdateCount < ExpectedUpdates) {
|
||||
TEST_FAILURE("%u Key updates occured. Expected %d", Stats.KeyUpdateCount, ExpectedUpdates);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2092,15 +2092,15 @@ QuicTestCidUpdate(
|
|||
|
||||
CxPlatSleep(100);
|
||||
|
||||
QUIC_STATISTICS Stats = Client.GetStatistics();
|
||||
if (Stats.Recv.DecryptionFailures) {
|
||||
TEST_FAILURE("%llu server packets failed to decrypt!", Stats.Recv.DecryptionFailures);
|
||||
QUIC_STATISTICS_V2 Stats = Client.GetStatistics();
|
||||
if (Stats.RecvDecryptionFailures) {
|
||||
TEST_FAILURE("%llu server packets failed to decrypt!", Stats.RecvDecryptionFailures);
|
||||
return;
|
||||
}
|
||||
|
||||
Stats = Server->GetStatistics();
|
||||
if (Stats.Recv.DecryptionFailures) {
|
||||
TEST_FAILURE("%llu client packets failed to decrypt!", Stats.Recv.DecryptionFailures);
|
||||
if (Stats.RecvDecryptionFailures) {
|
||||
TEST_FAILURE("%llu client packets failed to decrypt!", Stats.RecvDecryptionFailures);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -198,10 +198,10 @@ QuicTestMtuSettings()
|
|||
//
|
||||
// Ensure our MTU is in the middle somewhere
|
||||
//
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
TEST_QUIC_SUCCEEDED(Connection.GetStatistics(&Stats));
|
||||
TEST_NOT_EQUAL(1500, Stats.Send.PathMtu);
|
||||
TEST_NOT_EQUAL(1280, Stats.Send.PathMtu);
|
||||
TEST_NOT_EQUAL(1500, Stats.SendPathMtu);
|
||||
TEST_NOT_EQUAL(1280, Stats.SendPathMtu);
|
||||
|
||||
ServerDropper.ClientDropPacketSize = 0xFFFF;
|
||||
|
||||
|
@ -217,7 +217,7 @@ QuicTestMtuSettings()
|
|||
// Ensure our MTU is in the max
|
||||
//
|
||||
TEST_QUIC_SUCCEEDED(Connection.GetStatistics(&Stats));
|
||||
TEST_EQUAL(1500, Stats.Send.PathMtu);
|
||||
TEST_EQUAL(1500, Stats.SendPathMtu);
|
||||
|
||||
TEST_QUIC_SUCCEEDED(Stream.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN));
|
||||
|
||||
|
@ -278,9 +278,9 @@ QuicTestMtuDiscovery(
|
|||
//
|
||||
// Assert our maximum MTUs
|
||||
//
|
||||
QUIC_STATISTICS ClientStats;
|
||||
QUIC_STATISTICS_V2 ClientStats;
|
||||
QUIC_STATUS ClientSuccess = Connection.GetStatistics(&ClientStats);
|
||||
QUIC_STATISTICS ServerStats;
|
||||
QUIC_STATISTICS_V2 ServerStats;
|
||||
QUIC_STATUS ServerSuccess = Context.Connection->GetStatistics(&ServerStats);
|
||||
|
||||
Connection.Shutdown(1);
|
||||
|
@ -289,8 +289,8 @@ QuicTestMtuDiscovery(
|
|||
TEST_QUIC_SUCCEEDED(ClientSuccess);
|
||||
TEST_QUIC_SUCCEEDED(ServerSuccess);
|
||||
|
||||
TEST_EQUAL(ClientExpectedMtu, ClientStats.Send.PathMtu);
|
||||
TEST_EQUAL(ServerExpectedMtu, ServerStats.Send.PathMtu);
|
||||
TEST_EQUAL(ClientExpectedMtu, ClientStats.SendPathMtu);
|
||||
TEST_EQUAL(ServerExpectedMtu, ServerStats.SendPathMtu);
|
||||
|
||||
Context.ShutdownEvent.WaitTimeout(2000);
|
||||
}
|
||||
|
|
|
@ -90,12 +90,12 @@ void QuicTestRegistrationShutdownAfterConnOpen()
|
|||
|
||||
// Call something that will hit the worker thread, that will ensure conn has
|
||||
// been triggered
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
uint32_t StatsSize = sizeof(Stats);
|
||||
Status =
|
||||
MsQuic->GetParam(
|
||||
Conn.Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
TEST_QUIC_STATUS(QUIC_STATUS_SUCCESS, Status);
|
||||
|
@ -126,12 +126,12 @@ void QuicTestRegistrationShutdownAfterConnOpenBeforeStart()
|
|||
|
||||
// Call something that will hit the worker thread, that will ensure conn has
|
||||
// been triggered
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
uint32_t StatsSize = sizeof(Stats);
|
||||
Status =
|
||||
MsQuic->GetParam(
|
||||
Conn.Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
TEST_QUIC_STATUS(QUIC_STATUS_SUCCESS, Status);
|
||||
|
@ -150,7 +150,7 @@ void QuicTestRegistrationShutdownAfterConnOpenBeforeStart()
|
|||
Status =
|
||||
MsQuic->GetParam(
|
||||
Conn.Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
TEST_QUIC_STATUS(QUIC_STATUS_SUCCESS, Status);
|
||||
|
@ -194,12 +194,12 @@ void QuicTestRegistrationShutdownAfterConnOpenAndStart()
|
|||
|
||||
// Call something that will hit the worker thread, that will ensure conn has
|
||||
// been triggered
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
uint32_t StatsSize = sizeof(Stats);
|
||||
Status =
|
||||
MsQuic->GetParam(
|
||||
Conn.Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
TEST_QUIC_STATUS(QUIC_STATUS_SUCCESS, Status);
|
||||
|
@ -219,7 +219,7 @@ void QuicTestRegistrationShutdownAfterConnOpenAndStart()
|
|||
Status =
|
||||
MsQuic->GetParam(
|
||||
Conn.Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&StatsSize,
|
||||
&Stats);
|
||||
TEST_QUIC_STATUS(QUIC_STATUS_SUCCESS, Status);
|
||||
|
|
|
@ -301,7 +301,7 @@ QuicDrillInitialPacketFailureTest(
|
|||
TEST_FAILURE("Get Listener statistics before test failed, 0x%x.", Status);
|
||||
return false;
|
||||
}
|
||||
DroppedPacketsBefore = Stats.Binding.Recv.DroppedPackets;
|
||||
DroppedPacketsBefore = Stats.BindingRecvDroppedPackets;
|
||||
|
||||
//
|
||||
// Send test packet to the server.
|
||||
|
@ -321,7 +321,7 @@ QuicDrillInitialPacketFailureTest(
|
|||
TEST_FAILURE("Get Listener statistics after test failed, 0x%x.", Status);
|
||||
return false;
|
||||
}
|
||||
DroppedPacketsAfter = Stats.Binding.Recv.DroppedPackets;
|
||||
DroppedPacketsAfter = Stats.BindingRecvDroppedPackets;
|
||||
|
||||
//
|
||||
// Validate the server rejected the packet just sent.
|
||||
|
|
|
@ -510,15 +510,15 @@ TestConnection::GetLocalUnidiStreamCount()
|
|||
return value;
|
||||
}
|
||||
|
||||
QUIC_STATISTICS
|
||||
QUIC_STATISTICS_V2
|
||||
TestConnection::GetStatistics()
|
||||
{
|
||||
QUIC_STATISTICS value = {};
|
||||
QUIC_STATISTICS_V2 value = {};
|
||||
uint32_t valueSize = sizeof(value);
|
||||
QUIC_STATUS Status =
|
||||
MsQuic->GetParam(
|
||||
QuicConnection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&valueSize,
|
||||
&value);
|
||||
if (QUIC_FAILED(Status)) {
|
||||
|
|
|
@ -254,7 +254,7 @@ public:
|
|||
uint16_t GetLocalBidiStreamCount();
|
||||
uint16_t GetLocalUnidiStreamCount();
|
||||
|
||||
QUIC_STATISTICS GetStatistics();
|
||||
QUIC_STATISTICS_V2 GetStatistics();
|
||||
|
||||
bool GetUseSendBuffer();
|
||||
QUIC_STATUS SetUseSendBuffer(bool value);
|
||||
|
|
|
@ -601,12 +601,12 @@ public:
|
|||
Alpn = strdup(NegotiatedAlpn);
|
||||
return true;
|
||||
}
|
||||
bool GetStatistics(QUIC_STATISTICS& Stats) {
|
||||
bool GetStatistics(QUIC_STATISTICS_V2& Stats) {
|
||||
uint32_t BufferLength = sizeof(Stats);
|
||||
if (QUIC_SUCCEEDED(
|
||||
MsQuic->GetParam(
|
||||
Connection,
|
||||
QUIC_PARAM_CONN_STATISTICS,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2,
|
||||
&BufferLength,
|
||||
&Stats)) &&
|
||||
BufferLength == sizeof(Stats)) {
|
||||
|
@ -780,7 +780,7 @@ RunInteropTest(
|
|||
if (Connection.ConnectToServer(Endpoint.ServerName, Port)) {
|
||||
Connection.GetQuicVersion(QuicVersionUsed);
|
||||
Connection.GetNegotiatedAlpn(NegotiatedAlpn);
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
if (Connection.GetStatistics(Stats)) {
|
||||
Success = Stats.VersionNegotiation != 0;
|
||||
}
|
||||
|
@ -817,7 +817,7 @@ RunInteropTest(
|
|||
Connection.GetQuicVersion(QuicVersionUsed);
|
||||
Connection.GetNegotiatedAlpn(NegotiatedAlpn);
|
||||
if (Feature == StatelessRetry) {
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
if (Connection.GetStatistics(Stats)) {
|
||||
Success = Stats.StatelessRetry != 0;
|
||||
}
|
||||
|
@ -874,9 +874,9 @@ RunInteropTest(
|
|||
Connection.GetQuicVersion(QuicVersionUsed);
|
||||
Connection.GetNegotiatedAlpn(NegotiatedAlpn);
|
||||
CxPlatSleep(2000); // Allow keep alive packets to trigger key updates.
|
||||
QUIC_STATISTICS Stats;
|
||||
QUIC_STATISTICS_V2 Stats;
|
||||
if (Connection.GetStatistics(Stats)) {
|
||||
Success = Stats.Misc.KeyUpdateCount > 1;
|
||||
Success = Stats.KeyUpdateCount > 1;
|
||||
}
|
||||
if (Success && CustomUrlPath) {
|
||||
Success = Connection.SendHttpRequests();
|
||||
|
|
|
@ -387,7 +387,7 @@ void SpinQuicSetRandomConnectionParam(HQUIC Connection)
|
|||
uint8_t RandomBuffer[8];
|
||||
SetParamHelper Helper;
|
||||
|
||||
switch (0x05000000 | (GetRandom(22))) {
|
||||
switch (0x05000000 | (GetRandom(24))) {
|
||||
case QUIC_PARAM_CONN_QUIC_VERSION: // uint32_t
|
||||
// QUIC_VERSION is get-only
|
||||
break;
|
||||
|
@ -445,6 +445,10 @@ void SpinQuicSetRandomConnectionParam(HQUIC Connection)
|
|||
CxPlatRandom(sizeof(RandomBuffer), RandomBuffer);
|
||||
Helper.SetPtr(QUIC_PARAM_CONN_INITIAL_DCID_PREFIX, RandomBuffer, 1 + (uint8_t)GetRandom(sizeof(RandomBuffer)));
|
||||
break;
|
||||
case QUIC_PARAM_CONN_STATISTICS_V2: // QUIC_STATISTICS_V2
|
||||
break; // Get Only
|
||||
case QUIC_PARAM_CONN_STATISTICS_V2_PLAT: // QUIC_STATISTICS_V2
|
||||
break; // Get Only
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -478,7 +482,7 @@ const uint32_t ParamCounts[] = {
|
|||
0,
|
||||
QUIC_PARAM_CONFIGURATION_DESIRED_VERSIONS + 1,
|
||||
QUIC_PARAM_LISTENER_CID_PREFIX + 1,
|
||||
QUIC_PARAM_CONN_TLS_SECRETS + 1,
|
||||
QUIC_PARAM_CONN_STATISTICS_V2_PLAT + 1,
|
||||
QUIC_PARAM_TLS_NEGOTIATED_ALPN + 1,
|
||||
#ifdef WIN32 // Schannel specific TLS parameters
|
||||
QUIC_PARAM_TLS_SCHANNEL_CONTEXT_ATTRIBUTE_W + 1,
|
||||
|
|
Загрузка…
Ссылка в новой задаче