This PR syncs the latest tracing refactoring work to hook up LTTng.
This commit is contained in:
Nick Banks 2019-12-21 10:21:23 -08:00 коммит произвёл GitHub
Родитель 0585f33bbd
Коммит 53198319bd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
70 изменённых файлов: 2803 добавлений и 1596 удалений

Просмотреть файл

@ -5,6 +5,7 @@ Gets procdump from the web if it doesn't already exist.
#>
mkdir bld
if ((Test-Path .\bld\procdump) -eq $false) {
# Download the zip file.
Invoke-WebRequest -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile bld\procdump.zip

10
.azure/prepare_linux.sh Normal file
Просмотреть файл

@ -0,0 +1,10 @@
#!/bin/bash
# Install LTTng.
echo "Installing LTTng..."
sudo apt-get install liblttng-ust-dev
sudo apt-get install lttng-tools
# Make sure syslog is started.
echo "Setting up syslog..."
sudo service rsyslog start

Просмотреть файл

@ -0,0 +1,9 @@
:: Install ProcDump if not already installed.
PowerShell .azure\get_procdump.ps1
:: Enable SChannel TLS 1.3 for client and server.
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v DisabledByDefault /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v Enabled /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v DisabledByDefault /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v Enabled /t REG_DWORD /d 1 /f

Просмотреть файл

@ -1,6 +1,7 @@
#!/bin/bash
# Enable core dumps.
echo "Enabling core dumps..."
ulimit -c unlimited
mkdir artifacts/dumps
cd artifacts/dumps
@ -8,4 +9,6 @@ cd artifacts/dumps
# Run spinquic for a while.
../bin/spinquic both -timeout:300000
ls
# Print any core files that might be generated.
echo "Available core dumps:"
ls

Просмотреть файл

@ -1,13 +1,4 @@
:: Install ProcDump if not already installed.
PowerShell .azure\get_procdump.ps1
:: Enable SChannel TLS 1.3 for client and server.
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v DisabledByDefault /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v Enabled /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v DisabledByDefault /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v Enabled /t REG_DWORD /d 1 /f
:: Start ProcDump.
mkdir artifacts\dumps
start bld\procdump\procdump64.exe -ma -e -b -accepteula -w spinquic.exe artifacts\dumps
@ -15,4 +6,5 @@ start bld\procdump\procdump64.exe -ma -e -b -accepteula -w spinquic.exe artifact
:: Run spinquic for a while.
artifacts\bin\debug\spinquic.exe both -timeout:300000
:: Print any dump files that might be generated.
dir artifacts\dumps

Просмотреть файл

@ -1,12 +1,11 @@
#!/bin/bash
# Setup logs.
echo "Making sure syslog is running..."
sudo service rsyslog start
echo "Clearing syslog file..."
sudo truncate -s 0 /var/log/syslog
# Enable core dumps.
echo "Enabling core dumps..."
ulimit -c unlimited
mkdir artifacts/dumps
cd artifacts/dumps
@ -16,6 +15,10 @@ cd artifacts/dumps
--gtest_filter=$1 \
--gtest_output=xml:../logs/linux-test-results.xml
# Print any core files that might be generated.
echo "Available core dumps:"
ls
# Copy logs to log folder (with correct permsissions).
echo "Copying logs..."
cd ../logs

Просмотреть файл

@ -1,13 +1,4 @@
:: Install ProcDump if not already installed.
PowerShell .azure\get_procdump.ps1
:: Enable SChannel TLS 1.3 for client and server.
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v DisabledByDefault /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v Enabled /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v DisabledByDefault /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v Enabled /t REG_DWORD /d 1 /f
:: Start ProcDump
mkdir artifacts\dumps
start bld\procdump\procdump64.exe -ma -e -b -accepteula -w msquictest.exe artifacts\dumps
@ -28,6 +19,9 @@ artifacts\bin\debug\msquictest.exe ^
--gtest_filter=%1 ^
--gtest_output=xml:artifacts\logs\windows-test-results.xml
:: Print any dump files that might be generated.
dir artifacts\dumps
:: Stop log collection.
netsh trace stop sessionname=quic

Просмотреть файл

@ -84,8 +84,9 @@ else()
# Custom build flags.
set(QUIC_COMMON_FLAGS "-DQUIC_PLATFORM_LINUX -fms-extensions -fPIC -Wall -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-value -pthread")
if(QUIC_ENABLE_LOGGING)
message(STATUS "Configuring for syslog events and logging")
set(QUIC_COMMON_FLAGS "${QUIC_COMMON_FLAGS} -DQUIC_EVENTS_SYSLOG -DQUIC_LOGS_SYSLOG")
include(FindLTTngUST)
message(STATUS "Configuring for LTTng events and disabling logging")
set(QUIC_COMMON_FLAGS "${QUIC_COMMON_FLAGS} -DQUIC_EVENTS_LTTNG -DQUIC_LOGS_STUB")
else()
message(STATUS "Disabling events and logging")
set(QUIC_COMMON_FLAGS "${QUIC_COMMON_FLAGS} -DQUIC_EVENTS_STUB -DQUIC_LOGS_STUB")

Просмотреть файл

@ -9,41 +9,49 @@ strategy:
linux-stub:
platform: 'Linux-Stub'
imageName: 'ubuntu-latest'
prepareCmd: 'bash ./.azure/prepare_linux.sh'
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=stub -DQUIC_ENABLE_LOGGING=off'
testCmd: 'bash ./.azure/test_linux.sh ''*'''
linux-stub-sanitize:
platform: 'Linux-Stub-Sanitize'
imageName: 'ubuntu-latest'
prepareCmd: 'bash ./.azure/prepare_linux.sh'
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=stub -DQUIC_SANITIZE_ADDRESS=on'
testCmd: 'bash ./.azure/test_linux.sh AppData/WithSendArgs2.SendLarge/0'
linux-stub-spin:
platform: 'Linux-Stub-Spin'
imageName: 'ubuntu-latest'
prepareCmd: 'bash ./.azure/prepare_linux.sh'
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=stub -DQUIC_ENABLE_LOGGING=off -DQUIC_SANITIZE_ADDRESS=on'
testCmd: 'bash ./.azure/spin_linux.sh'
linux-openssl:
platform: 'Linux-OpenSSL'
imageName: 'ubuntu-latest'
prepareCmd: 'bash ./.azure/prepare_linux.sh'
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=openssl -DQUIC_ENABLE_LOGGING=off'
testCmd: 'bash ./.azure/test_linux.sh ''*'''
windows-x64-stub:
platform: 'Windows-x64-Stub'
imageName: 'windows-latest'
prepareCmd: '.\.azure\prepare_windows.cmd'
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=stub'
testCmd: '.\.azure\test_windows.cmd -*Unreachable/0'
windows-x64-stub-spin:
platform: 'Windows-x64-Stub-Spin'
imageName: 'windows-latest'
prepareCmd: '.\.azure\prepare_windows.cmd'
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=stub'
testCmd: '.\.azure\spin_windows.cmd'
windows-x64-mitls:
platform: 'Windows-x64-miTLS'
imageName: 'windows-latest'
prepareCmd: '.\.azure\prepare_windows.cmd'
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=mitls'
testCmd: '.\.azure\test_windows.cmd -*Unreachable/0'
windows-x64-schannel:
platform: 'Windows-x64-Schannel'
imageName: 'windows-latest'
prepareCmd: '.\.azure\prepare_windows.cmd'
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=schannel'
testCmd: '.\.azure\test_windows.cmd ParameterValidation.*'
@ -55,6 +63,11 @@ steps:
submodules: recursive
persistCredentials: true
- task: CmdLine@2
displayName: 'Prepare Image'
inputs:
script: '$(prepareCmd)'
- task: CMake@1
displayName: 'CMake Generator'
inputs:

Просмотреть файл

@ -32,7 +32,6 @@ set(SOURCES
stream_send.c
stream_set.c
timer_wheel.c
utils.c
worker.c
)

Просмотреть файл

@ -144,7 +144,7 @@ QuicAckTrackerAckPacket(
return;
}
LogVerbose("[%c][RX][%llu] Marked for ACK", PtkConnPre(Connection), PacketNumber);
QuicTraceLogVerbose("[%c][RX][%llu] Marked for ACK", PtkConnPre(Connection), PacketNumber);
QuicRangeValidate(&Tracker->PacketNumbersToAck);
BOOLEAN NewLargestPacketNumber =

Просмотреть файл

@ -46,7 +46,7 @@ MsQuicConnectionOpen(
QUIC_SESSION* Session;
QUIC_CONNECTION* Connection = NULL;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_CONNECTION_OPEN,
SessionHandle);
@ -76,7 +76,7 @@ MsQuicConnectionOpen(
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -95,7 +95,7 @@ MsQuicConnectionClose(
QUIC_PASSIVE_CODE();
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_CONNECTION_CLOSE,
Handle);
@ -134,7 +134,7 @@ MsQuicConnectionClose(
// Queue the operation and wait for it to be processed.
//
QuicConnQueueOper(Connection, &Oper);
EventWriteQuicApiWaitOperation();
QuicTraceEvent(ApiWaitOperation);
QuicEventWaitForever(CompletionEvent);
QuicEventUninitialize(CompletionEvent);
}
@ -152,7 +152,7 @@ MsQuicConnectionClose(
Error:
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
#pragma warning(pop)
@ -168,7 +168,7 @@ MsQuicConnectionShutdown(
QUIC_CONNECTION* Connection;
QUIC_OPERATION* Oper;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_CONNECTION_SHUTDOWN,
Handle);
@ -214,7 +214,7 @@ MsQuicConnectionShutdown(
Error:
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -235,7 +235,7 @@ MsQuicConnectionStart(
QUIC_PASSIVE_CODE();
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_CONNECTION_START,
Handle);
@ -265,7 +265,8 @@ MsQuicConnectionStart(
QUIC_CONN_VERIFY(Connection, !Connection->State.Freed);
if (!Connection->State.RemoteAddressSet && ServerName == NULL) {
if (QuicConnIsServer(Connection) ||
(!Connection->State.RemoteAddressSet && ServerName == NULL)) {
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Error;
}
@ -292,7 +293,7 @@ MsQuicConnectionStart(
ServerNameCopy = QUIC_ALLOC_NONPAGED(ServerNameLength + 1);
if (ServerNameCopy == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("Server name", ServerNameLength + 1);
QuicTraceEvent(AllocFailure, "Server name", ServerNameLength + 1);
goto Error;
}
@ -304,7 +305,7 @@ MsQuicConnectionStart(
Oper = QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_API_CALL);
if (Oper == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("CONN_START operation", 0);
QuicTraceEvent(AllocFailure, "CONN_START operation", 0);
goto Error;
}
Oper->API_CALL.Context->Type = QUIC_API_TYPE_CONN_START;
@ -321,7 +322,7 @@ MsQuicConnectionStart(
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -341,7 +342,7 @@ MsQuicStreamOpen(
QUIC_STATUS Status;
QUIC_CONNECTION* Connection;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_OPEN,
Handle);
@ -377,7 +378,7 @@ MsQuicStreamOpen(
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -397,7 +398,7 @@ MsQuicStreamClose(
QUIC_PASSIVE_CODE();
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_CLOSE,
Handle);
@ -458,14 +459,14 @@ MsQuicStreamClose(
// Queue the operation and wait for it to be processed.
//
QuicConnQueueOper(Connection, &Oper);
EventWriteQuicApiWaitOperation();
QuicTraceEvent(ApiWaitOperation);
QuicEventWaitForever(CompletionEvent);
QuicEventUninitialize(CompletionEvent);
}
Error:
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
#pragma warning(pop)
@ -481,7 +482,7 @@ MsQuicStreamStart(
QUIC_STREAM* Stream;
QUIC_CONNECTION* Connection;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_START,
Handle);
@ -519,7 +520,7 @@ MsQuicStreamStart(
QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_API_CALL);
if (Oper == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("STRM_START operation", 0);
QuicTraceEvent(AllocFailure, "STRM_START operation", 0);
goto Exit;
}
Oper->API_CALL.Context->Type = QUIC_API_TYPE_STRM_START;
@ -562,14 +563,14 @@ MsQuicStreamStart(
// Queue the operation and wait for it to be processed.
//
QuicConnQueueOper(Connection, &Oper);
EventWriteQuicApiWaitOperation();
QuicTraceEvent(ApiWaitOperation);
QuicEventWaitForever(CompletionEvent);
QuicEventUninitialize(CompletionEvent);
}
Exit:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -588,7 +589,7 @@ MsQuicStreamShutdown(
QUIC_CONNECTION* Connection;
QUIC_OPERATION* Oper;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_SHUTDOWN,
Handle);
@ -644,7 +645,7 @@ MsQuicStreamShutdown(
Oper = QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_API_CALL);
if (Oper == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("STRM_SHUTDOWN operation", 0);
QuicTraceEvent(AllocFailure, "STRM_SHUTDOWN operation", 0);
goto Error;
}
Oper->API_CALL.Context->Type = QUIC_API_TYPE_STRM_SHUTDOWN;
@ -667,7 +668,7 @@ MsQuicStreamShutdown(
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -692,7 +693,7 @@ MsQuicStreamSend(
BOOLEAN QueueOper = TRUE;
QUIC_OPERATION* Oper;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_SEND,
Handle);
@ -727,7 +728,7 @@ MsQuicStreamSend(
}
if (TotalLength > UINT32_MAX) {
EventWriteQuicStreamError(Stream, "Send request total length exceeds max");
QuicTraceEvent(StreamError, Stream, "Send request total length exceeds max");
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Exit;
}
@ -741,7 +742,7 @@ MsQuicStreamSend(
SendRequest = QuicPoolAlloc(&Connection->Worker->SendRequestPool);
if (SendRequest == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("Stream Send request", 0);
QuicTraceEvent(AllocFailure, "Stream Send request", 0);
goto Exit;
}
@ -775,7 +776,7 @@ MsQuicStreamSend(
Oper = QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_API_CALL);
if (Oper == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("STRM_SEND operation", 0);
QuicTraceEvent(AllocFailure, "STRM_SEND operation", 0);
goto Exit;
}
Oper->API_CALL.Context->Type = QUIC_API_TYPE_STRM_SEND;
@ -798,7 +799,7 @@ MsQuicStreamSend(
Exit:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -816,7 +817,7 @@ MsQuicStreamReceiveSetEnabled(
QUIC_CONNECTION* Connection;
QUIC_OPERATION* Oper;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_RECEIVE_SET_ENABLED,
Handle);
@ -841,7 +842,7 @@ MsQuicStreamReceiveSetEnabled(
Oper = QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_API_CALL);
if (Oper == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("STRM_RECV_SET_ENABLED, operation", 0);
QuicTraceEvent(AllocFailure, "STRM_RECV_SET_ENABLED, operation", 0);
goto Error;
}
Oper->API_CALL.Context->Type = QUIC_API_TYPE_STRM_RECV_SET_ENABLED;
@ -863,7 +864,7 @@ MsQuicStreamReceiveSetEnabled(
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -881,7 +882,7 @@ MsQuicStreamReceiveComplete(
QUIC_CONNECTION* Connection;
QUIC_OPERATION* Oper;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_STREAM_RECEIVE_COMPLETE,
Handle);
@ -911,7 +912,7 @@ MsQuicStreamReceiveComplete(
Oper = QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_API_CALL);
if (Oper == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("STRM_RECV_COMPLETE operation", 0);
QuicTraceEvent(AllocFailure, "STRM_RECV_COMPLETE operation", 0);
goto Exit;
}
@ -934,7 +935,7 @@ MsQuicStreamReceiveComplete(
Exit:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -957,7 +958,7 @@ MsQuicSetParam(
return QUIC_STATUS_INVALID_PARAMETER;
}
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SET_PARAM,
Handle);
@ -1021,13 +1022,13 @@ MsQuicSetParam(
// Queue the operation and wait for it to be processed.
//
QuicConnQueueOper(Connection, &Oper);
EventWriteQuicApiWaitOperation();
QuicTraceEvent(ApiWaitOperation);
QuicEventWaitForever(CompletionEvent);
QuicEventUninitialize(CompletionEvent);
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -1052,7 +1053,7 @@ MsQuicGetParam(
QUIC_STATUS Status;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SET_PARAM,
Handle);
@ -1114,13 +1115,13 @@ MsQuicGetParam(
// Queue the operation and wait for it to be processed.
//
QuicConnQueueOper(Connection, &Oper);
EventWriteQuicApiWaitOperation();
QuicTraceEvent(ApiWaitOperation);
QuicEventWaitForever(CompletionEvent);
QuicEventUninitialize(CompletionEvent);
Error:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}

Просмотреть файл

@ -52,7 +52,7 @@ QuicBindingInitialize(
Binding = QUIC_ALLOC_NONPAGED(sizeof(QUIC_BINDING));
if (Binding == NULL) {
EventWriteQuicAllocFailure("QUIC_BINDING", sizeof(QUIC_BINDING));
QuicTraceEvent(AllocFailure, "QUIC_BINDING", sizeof(QUIC_BINDING));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -86,7 +86,7 @@ QuicBindingInitialize(
sizeof(HashSalt),
&Binding->ResetTokenHash);
if (QUIC_FAILED(Status)) {
EventWriteQuicBindingErrorStatus(Binding, Status, "Create reset token hash");
QuicTraceEvent(BindingErrorStatus, Binding, Status, "Create reset token hash");
goto Error;
}
@ -98,7 +98,7 @@ QuicBindingInitialize(
if (PrevCompartmentId != CompartmentId) {
Status = QuicCompartmentIdSetCurrent(CompartmentId);
if (QUIC_FAILED(Status)) {
EventWriteQuicBindingErrorStatus(Binding, Status, "Set current compartment Id");
QuicTraceEvent(BindingErrorStatus, Binding, Status, "Set current compartment Id");
goto Error;
}
RevertCompartmentId = TRUE;
@ -120,14 +120,14 @@ QuicBindingInitialize(
#endif
if (QUIC_FAILED(Status)) {
EventWriteQuicBindingErrorStatus(Binding, Status, "Create datapath binding");
QuicTraceEvent(BindingErrorStatus, Binding, Status, "Create datapath binding");
goto Error;
}
QUIC_ADDR DatapathLocalAddr, DatapathRemoteAddr;
QuicDataPathBindingGetLocalAddress(Binding->DatapathBinding, &DatapathLocalAddr);
QuicDataPathBindingGetRemoteAddress(Binding->DatapathBinding, &DatapathRemoteAddr);
EventWriteQuicBindingCreated(
QuicTraceEvent(BindingCreated,
Binding, Binding->DatapathBinding,
LOG_ADDR_LEN(DatapathLocalAddr), LOG_ADDR_LEN(DatapathRemoteAddr),
(uint8_t*)&DatapathLocalAddr, (uint8_t*)&DatapathRemoteAddr);
@ -158,7 +158,7 @@ QuicBindingUninitialize(
_In_ QUIC_BINDING* Binding
)
{
EventWriteQuicBindingCleanup(Binding);
QuicTraceEvent(BindingCleanup, Binding);
QUIC_TEL_ASSERT(Binding->RefCount == 0);
QUIC_TEL_ASSERT(Binding->HandshakeConnections == 0);
@ -200,7 +200,7 @@ QuicBindingUninitialize(
QuicDispatchRwLockUninitialize(&Binding->RwLock);
QUIC_FREE(Binding);
EventWriteQuicBindingDestroyed(Binding);
QuicTraceEvent(BindingDestroyed, Binding);
}
_IRQL_requires_max_(DISPATCH_LEVEL)
@ -214,7 +214,7 @@ QuicBindingTraceRundown(
QUIC_ADDR DatapathLocalAddr, DatapathRemoteAddr;
QuicDataPathBindingGetLocalAddress(Binding->DatapathBinding, &DatapathLocalAddr);
QuicDataPathBindingGetRemoteAddress(Binding->DatapathBinding, &DatapathRemoteAddr);
EventWriteQuicBindingRundown(
QuicTraceEvent(BindingRundown,
Binding, Binding->DatapathBinding,
LOG_ADDR_LEN(DatapathLocalAddr), LOG_ADDR_LEN(DatapathRemoteAddr),
(uint8_t*)&DatapathLocalAddr, (uint8_t*)&DatapathRemoteAddr);
@ -300,7 +300,7 @@ QuicBindingRegisterListener(
if (NewAlpnLength == ExistingAlpnLength &&
memcmp(NewAlpn, ExistingAlpn, NewAlpnLength) == 0) { // Pre-existing match found.
LogWarning("[bind][%p] Listener (%p) already registered on ALPN %s",
QuicTraceLogWarning("[bind][%p] Listener (%p) already registered on ALPN %s",
Binding, ExistingListener, NewAlpn);
AddNewListener = FALSE;
break;
@ -615,7 +615,7 @@ QuicBindingQueueStatelessOperation(
QUIC_OPERATION* Oper = QuicOperationAlloc(Worker, OperType);
if (Oper == NULL) {
EventWriteQuicAllocFailure("stateless operation", sizeof(QUIC_OPERATION));
QuicTraceEvent(AllocFailure, "stateless operation", sizeof(QUIC_OPERATION));
QuicPacketLogDrop(Binding, QuicDataPathRecvDatagramToRecvPacket(Datagram),
"Alloc failure for stateless operation");
QuicBindingReleaseStatelessOperation(Context, FALSE);
@ -642,12 +642,12 @@ QuicBindingProcessStatelessOperation(
QUIC_DBG_ASSERT(RecvPacket->ValidatedHeaderInv);
EventWriteQuicBindingExecOper(Binding, OperationType);
QuicTraceEvent(BindingExecOper, Binding, OperationType);
QUIC_DATAPATH_SEND_CONTEXT* SendContext =
QuicDataPathBindingAllocSendContext(Binding->DatapathBinding, 0);
if (SendContext == NULL) {
EventWriteQuicAllocFailure("stateless send context", 0);
QuicTraceEvent(AllocFailure, "stateless send context", 0);
goto Exit;
}
@ -667,7 +667,7 @@ QuicBindingProcessStatelessOperation(
QUIC_BUFFER* SendDatagram =
QuicDataPathBindingAllocSendDatagram(SendContext, PacketLength);
if (SendDatagram == NULL) {
EventWriteQuicAllocFailure("vn datagram", PacketLength);
QuicTraceEvent(AllocFailure, "vn datagram", PacketLength);
goto Exit;
}
@ -705,7 +705,7 @@ QuicBindingProcessStatelessOperation(
QuicSupportedVersionList,
sizeof(QuicSupportedVersionList));
LogVerbose("[S][TX][-] VN");
QuicTraceLogVerbose("[S][TX][-] VN");
} else if (OperationType == QUIC_OPER_TYPE_STATELESS_RESET) {
@ -741,7 +741,7 @@ QuicBindingProcessStatelessOperation(
QUIC_BUFFER* SendDatagram =
QuicDataPathBindingAllocSendDatagram(SendContext, PacketLength);
if (SendDatagram == NULL) {
EventWriteQuicAllocFailure("reset datagram", PacketLength);
QuicTraceEvent(AllocFailure, "reset datagram", PacketLength);
goto Exit;
}
@ -760,7 +760,7 @@ QuicBindingProcessStatelessOperation(
RecvPacket->DestCID,
SendDatagram->Buffer + PacketLength - QUIC_STATELESS_RESET_TOKEN_LENGTH);
LogVerbose("[S][TX][-] SR %s",
QuicTraceLogVerbose("[S][TX][-] SR %s",
QuicCidBufToStr(
SendDatagram->Buffer + PacketLength - QUIC_STATELESS_RESET_TOKEN_LENGTH,
QUIC_STATELESS_RESET_TOKEN_LENGTH
@ -775,7 +775,7 @@ QuicBindingProcessStatelessOperation(
QUIC_BUFFER* SendDatagram =
QuicDataPathBindingAllocSendDatagram(SendContext, PacketLength);
if (SendDatagram == NULL) {
EventWriteQuicAllocFailure("retry datagram", PacketLength);
QuicTraceEvent(AllocFailure, "retry datagram", PacketLength);
QuicDataPathBindingFreeSendContext(SendContext);
goto Exit;
}
@ -811,8 +811,7 @@ QuicBindingProcessStatelessOperation(
(uint8_t*)SendDatagram->Buffer);
QUIC_DBG_ASSERT(SendDatagram->Length != 0);
LogVerbose(
"[S][TX][-] LH Ver:0x%x DestCID:%s SrcCID:%s Type:R OrigDestCID:%s (Token %hu bytes)",
QuicTraceLogVerbose("[S][TX][-] LH Ver:0x%x DestCID:%s SrcCID:%s Type:R OrigDestCID:%s (Token %hu bytes)",
RecvPacket->LH->Version,
QuicCidBufToStr(RecvPacket->SourceCID, RecvPacket->SourceCIDLen).Buffer,
QuicCidBufToStr(NewDestCID, MSQUIC_CONNECTION_ID_LENGTH).Buffer,
@ -1471,11 +1470,11 @@ QuicBindingSendTo(
RemoteAddress,
SendContext);
if (QUIC_FAILED(Status)) {
LogWarning("[bind][%p] SendTo failed, 0x%x", Binding, Status);
QuicTraceLogWarning("[bind][%p] SendTo failed, 0x%x", Binding, Status);
}
#if QUIC_SEND_FAKE_LOSS
} else {
LogVerbose("[bind][%p] Dropped (fake loss) packet", Binding);
QuicTraceLogVerbose("[bind][%p] Dropped (fake loss) packet", Binding);
QuicDataPathBindingFreeSendContext(SendContext);
Status = QUIC_STATUS_SUCCESS;
}
@ -1505,11 +1504,11 @@ QuicBindingSendFromTo(
RemoteAddress,
SendContext);
if (QUIC_FAILED(Status)) {
LogWarning("[bind][%p] SendFromTo failed, 0x%x", Binding, Status);
QuicTraceLogWarning("[bind][%p] SendFromTo failed, 0x%x", Binding, Status);
}
#if QUIC_SEND_FAKE_LOSS
} else {
LogVerbose("[bind][%p] Dropped (fake loss) packet", Binding);
QuicTraceLogVerbose("[bind][%p] Dropped (fake loss) packet", Binding);
QuicDataPathBindingFreeSendContext(SendContext);
Status = QUIC_STATUS_SUCCESS;
}

Просмотреть файл

@ -77,7 +77,7 @@ QuicConnLogCubic(
_In_ const QUIC_CONNECTION* const Connection
)
{
EventWriteQuicConnCubic(
QuicTraceEvent(ConnCubic,
Connection,
Connection->CongestionControl.SlowStartThreshold,
Connection->CongestionControl.KCubic,
@ -251,7 +251,7 @@ QuicCongestionControlOnCongestionEvent(
)
{
QUIC_CONNECTION* Connection = QuicCongestionControlGetConnection(Cc);
EventWriteQuicConnCongestion(Connection);
QuicTraceEvent(ConnCongestion, Connection);
Connection->Stats.Send.CongestionCount++;
Cc->IsInRecovery = TRUE;
@ -297,7 +297,7 @@ QuicCongestionControlOnPersistentCongestionEvent(
)
{
QUIC_CONNECTION* Connection = QuicCongestionControlGetConnection(Cc);
EventWriteQuicConnPersistentCongestion(Connection);
QuicTraceEvent(ConnPersistentCongestion, Connection);
Connection->Stats.Send.PersistentCongestionCount++;
Cc->IsInPersistentCongestion = TRUE;
@ -370,7 +370,7 @@ QuicCongestionControlOnDataAcknowledged(
// bit differently here than in TCP: we simply require an ACK for a
// packet sent after recovery started.
//
EventWriteQuicConnRecoveryExit(Connection);
QuicTraceEvent(ConnRecoveryExit, Connection);
Cc->IsInRecovery = FALSE;
Cc->IsInPersistentCongestion = FALSE;
Cc->TimeOfCongAvoidStart = QuicTimeMs64();

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -638,7 +638,7 @@ QuicConnLogOutFlowStats(
_In_ const QUIC_CONNECTION* const Connection
)
{
if (!EventEnabledQuicConnOutFlowStats()) {
if (!QuicTraceEventEnabled(ConnOutFlowStats)) {
return;
}
@ -650,9 +650,23 @@ QuicConnLogOutFlowStats(
&FcAvailable,
&SendWindow);
#ifdef QUIC_EVENTS_LTTNG // LTTng has a max of 10 fields.
QuicTraceEvent(
ConnOutFlowStats,
Connection,
Connection->Stats.Send.TotalBytes,
Connection->CongestionControl.BytesInFlight,
Connection->CongestionControl.BytesInFlightMax,
Connection->CongestionControl.CongestionWindow,
Connection->CongestionControl.SlowStartThreshold,
Connection->Send.PeerMaxData - Connection->Send.OrderedStreamBytesSent,
FcAvailable,
Connection->SendBuffer.IdealBytes,
Connection->SendBuffer.PostedBytes);
#else
const QUIC_PATH* Path = &Connection->Paths[0];
EventWriteQuicConnOutFlowStats(
QuicTraceEvent(
ConnOutFlowStats,
Connection,
Connection->Stats.Send.TotalBytes,
Connection->CongestionControl.BytesInFlight,
@ -665,6 +679,7 @@ QuicConnLogOutFlowStats(
Connection->SendBuffer.PostedBytes,
Path->GotFirstRttSample ? Path->SmoothedRtt : 0,
SendWindow);
#endif
}
inline
@ -673,7 +688,8 @@ QuicConnLogInFlowStats(
_In_ const QUIC_CONNECTION* const Connection
)
{
EventWriteQuicConnInFlowStats(
QuicTraceEvent(
ConnInFlowStats,
Connection,
Connection->Stats.Recv.TotalBytes);
}
@ -684,8 +700,23 @@ QuicConnLogStatistics(
_In_ const QUIC_CONNECTION* const Connection
)
{
#ifdef QUIC_EVENTS_LTTNG // LTTng has a max of 10 fields.
QuicTraceEvent(
ConnStatistics,
Connection,
QuicTimeDiff64(Connection->Stats.Timing.Start, QuicTimeUs64()),
Connection->Stats.Send.TotalPackets,
Connection->Stats.Send.SuspectedLostPackets,
Connection->Stats.Send.SpuriousLostPackets,
Connection->Stats.Recv.TotalPackets,
Connection->Stats.Recv.ReorderedPackets,
Connection->Stats.Recv.DroppedPackets,
Connection->Stats.Recv.DuplicatePackets,
Connection->Stats.Recv.DecryptionFailures);
#else
const QUIC_PATH* Path = &Connection->Paths[0];
EventWriteQuicConnStatistics(
QuicTraceEvent(
ConnStatistics,
Connection,
QuicTimeDiff64(Connection->Stats.Timing.Start, QuicTimeUs64()),
Connection->Stats.Send.TotalPackets,
@ -701,6 +732,7 @@ QuicConnLogStatistics(
Connection->Stats.Send.TotalBytes,
Connection->Stats.Recv.TotalBytes,
Path->SmoothedRtt);
#endif
}
inline
@ -712,7 +744,7 @@ QuicConnAddOutFlowBlockedReason(
{
if (!(Connection->OutFlowBlockedReasons & Reason)) {
Connection->OutFlowBlockedReasons |= Reason;
EventWriteQuicConnOutFlowBlocked(Connection, Connection->OutFlowBlockedReasons);
QuicTraceEvent(ConnOutFlowBlocked, Connection, Connection->OutFlowBlockedReasons);
return TRUE;
}
return FALSE;
@ -727,7 +759,7 @@ QuicConnRemoveOutFlowBlockedReason(
{
if ((Connection->OutFlowBlockedReasons & Reason)) {
Connection->OutFlowBlockedReasons &= ~Reason;
EventWriteQuicConnOutFlowBlocked(Connection, Connection->OutFlowBlockedReasons);
QuicTraceEvent(ConnOutFlowBlocked, Connection, Connection->OutFlowBlockedReasons);
return TRUE;
}
return FALSE;

Просмотреть файл

@ -33,12 +33,11 @@ QuicCryptoDumpSendState(
_In_ QUIC_CRYPTO* Crypto
)
{
if (LogVerboseEnabled()) {
if (QuicTraceLogVerboseEnabled()) {
QUIC_CONNECTION* Connection = QuicCryptoGetConnection(Crypto);
LogVerbose("[cryp][%p] QS:%u MAX:%u UNA:%u NXT:%u RECOV:%u-%u",
Connection,
QuicTraceLogConnVerbose(CryptoDump, Connection, "QS:%u MAX:%u UNA:%u NXT:%u RECOV:%u-%u",
Crypto->TlsState.BufferTotalLength,
Crypto->MaxSentLength,
Crypto->UnAckedOffset,
@ -50,13 +49,11 @@ QuicCryptoDumpSendState(
uint32_t i = 0;
QUIC_SUBRANGE* Sack;
while ((Sack = QuicRangeGetSafe(&Crypto->SparseAckRanges, i++)) != NULL) {
LogVerbose("[cryp][%p] unACKed: [%llu, %llu]",
Connection, UnAcked, Sack->Low);
QuicTraceLogConnVerbose(CryptoDumpUnacked, Connection, " unACKed: [%llu, %llu]", UnAcked, Sack->Low);
UnAcked = Sack->Low + Sack->Count;
}
if (UnAcked < (uint64_t)Crypto->MaxSentLength) {
LogVerbose("[cryp][%p] unACKed: [%llu, %u]",
Connection, UnAcked, Crypto->MaxSentLength);
QuicTraceLogConnVerbose(CryptoDumpUnacked, Connection, " unACKed: [%llu, %u]", UnAcked, Crypto->MaxSentLength);
}
QUIC_DBG_ASSERT(Crypto->UnAckedOffset <= Crypto->NextSendOffset);
@ -89,7 +86,7 @@ QuicCryptoInitialize(
Crypto->TlsState.BufferAllocLength = SendBufferLength;
Crypto->TlsState.Buffer = QUIC_ALLOC_NONPAGED(SendBufferLength);
if (Crypto->TlsState.Buffer == NULL) {
EventWriteQuicAllocFailure("crypto send buffer", SendBufferLength);
QuicTraceEvent(AllocFailure, "crypto send buffer", SendBufferLength);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -146,7 +143,7 @@ QuicCryptoInitialize(
&Crypto->TlsState.ReadKeys[QUIC_PACKET_KEY_INITIAL],
&Crypto->TlsState.WriteKeys[QUIC_PACKET_KEY_INITIAL]);
if (QUIC_FAILED(Status)) {
EventWriteQuicConnErrorStatus(Connection, Status, "Creating initial keys");
QuicTraceEvent(ConnErrorStatus, Connection, Status, "Creating initial keys");
goto Exit;
}
QUIC_DBG_ASSERT(Crypto->TlsState.ReadKeys[QUIC_PACKET_KEY_INITIAL] != NULL);
@ -243,7 +240,7 @@ QuicCryptoInitializeTls(
Status = QuicTlsInitialize(&TlsConfig, &Crypto->TLS);
if (QUIC_FAILED(Status)) {
EventWriteQuicConnErrorStatus(Connection, Status, "QuicTlsInitialize");
QuicTraceEvent(ConnErrorStatus, Connection, Status, "QuicTlsInitialize");
QUIC_FREE(TlsConfig.LocalTPBuffer);
goto Error;
}
@ -304,7 +301,7 @@ QuicCryptoDiscardKeys(
}
QUIC_CONNECTION* Connection = QuicCryptoGetConnection(Crypto);
LogInfo("[conn][%p] Discarding key type = %hu", Connection, KeyType);
QuicTraceLogConnInfo(DiscardKeyType, Connection, "Discarding key type = %hu", KeyType);
QuicPacketKeyFree(Crypto->TlsState.WriteKeys[KeyType]);
QuicPacketKeyFree(Crypto->TlsState.ReadKeys[KeyType]);
@ -348,7 +345,7 @@ QuicCryptoOnServerComplete(
_In_ QUIC_CRYPTO* Crypto
)
{
LogInfo("[conn][%p] Crypto/TLS state no longer needed.", QuicCryptoGetConnection(Crypto));
QuicTraceLogConnInfo(CryptoStateDiscard, QuicCryptoGetConnection(Crypto), "Crypto/TLS state no longer needed.");
if (Crypto->TLS != NULL) {
QuicTlsUninitialize(Crypto->TLS);
Crypto->TLS = NULL;
@ -421,8 +418,7 @@ QuicCryptoWriteOneFrame(
uint16_t HeaderLength = sizeof(uint8_t) + QuicVarIntSize(Offset);
if (*FrameBytes < HeaderLength + 4) {
LogVerbose("[cryp][%p] Can't squeeze in a frame (no room for header) with %hu bytes",
Connection, *FrameBytes);
QuicTraceLogConnVerbose(NoMoreRoomForCrypto, Connection, "Can't squeeze in a frame (no room for header) with %hu bytes", *FrameBytes);
*FramePayloadBytes = 0;
*FrameBytes = 0;
return;
@ -443,8 +439,8 @@ QuicCryptoWriteOneFrame(
QUIC_DBG_ASSERT(Frame.Length > 0);
LogVerbose("[cryp][%p] Sending %hu crypto bytes, offset=%u",
Connection, (uint16_t)Frame.Length, Offset);
QuicTraceLogConnVerbose(AddCryptoFrame, Connection, "Sending %hu crypto bytes, offset=%u",
(uint16_t)Frame.Length, Offset);
uint16_t BufferLength = *FrameBytes;
@ -792,8 +788,7 @@ QuicCryptoOnLoss(
QUIC_CONNECTION* Connection = QuicCryptoGetConnection(Crypto);
LogVerbose("[cryp][%p] Recovering crypto from %llu up to %llu",
Connection, Start, End);
QuicTraceLogConnVerbose(RecoverCrypto, Connection, "Recovering crypto from %llu up to %llu", Start, End);
if (!Crypto->InRecovery) {
Crypto->InRecovery = TRUE;
@ -826,8 +821,7 @@ QuicCryptoOnAck(
QUIC_CONNECTION* Connection = QuicCryptoGetConnection(Crypto);
LogVerbose("[cryp][%p] Received ack for %u crypto bytes, offset=%u",
Connection, Length, Offset);
QuicTraceLogConnVerbose(AckCrypto, Connection, "Received ack for %u crypto bytes, offset=%u", Length, Offset);
if (Offset <= Crypto->UnAckedOffset) {
@ -958,7 +952,7 @@ QuicCryptoProcessDataFrame(
} else if (!Crypto->Initialized) {
Status = QUIC_STATUS_SUCCESS;
LogWarning("[cryp][%p] Ignoring received crypto after cleanup.", Connection);
QuicTraceLogConnWarning(IgnoreCryptoFrame, Connection, "Ignoring received crypto after cleanup.");
} else {
@ -969,7 +963,7 @@ QuicCryptoProcessDataFrame(
(uint16_t)Frame->Length)) {
Status = QUIC_STATUS_SUCCESS;
} else {
EventWriteQuicConnError(
QuicTraceEvent(ConnError,
Connection, "Tried crypto with incorrect key.");
QuicConnTransportError(Connection, QUIC_ERROR_PROTOCOL_VIOLATION);
Status = QUIC_STATUS_INVALID_STATE;
@ -991,7 +985,7 @@ QuicCryptoProcessDataFrame(
DataReady);
if (QUIC_FAILED(Status)) {
if (Status == QUIC_STATUS_BUFFER_TOO_SMALL) {
EventWriteQuicConnError(
QuicTraceEvent(ConnError,
Connection, "Tried to write beyond crypto flow control limit.");
QuicConnTransportError(Connection, QUIC_ERROR_CRYPTO_BUFFER_EXCEEDED);
}
@ -999,8 +993,8 @@ QuicCryptoProcessDataFrame(
}
}
LogVerbose("[cryp][%p] Received %hu crypto bytes, offset=%llu Ready=%hu",
Connection, (uint16_t)Frame->Length, Frame->Offset, *DataReady);
QuicTraceLogConnVerbose(RecvCrypto, Connection, "Received %hu crypto bytes, offset=%llu Ready=%hu",
(uint16_t)Frame->Length, Frame->Offset, *DataReady);
Error:
@ -1078,7 +1072,7 @@ QuicCryptoProcessTlsCompletion(
QUIC_CONNECTION* Connection = QuicCryptoGetConnection(Crypto);
if (ResultFlags & QUIC_TLS_RESULT_ERROR) {
EventWriteQuicConnErrorStatus(
QuicTraceEvent(ConnErrorStatus,
Connection, Crypto->TlsState.AlertCode, "Received alert from TLS.");
QuicConnTransportError(
Connection,
@ -1087,13 +1081,13 @@ QuicCryptoProcessTlsCompletion(
}
if (ResultFlags & QUIC_TLS_RESULT_EARLY_DATA_ACCEPT) {
LogInfo("[conn][%p] 0-RTT accepted", Connection);
QuicTraceLogConnInfo(ZeroRttAccepted, Connection, "0-RTT accepted");
QUIC_TEL_ASSERT(Crypto->TlsState.EarlyDataAttempted);
QUIC_TEL_ASSERT(Crypto->TlsState.EarlyDataAccepted);
}
if (ResultFlags & QUIC_TLS_RESULT_EARLY_DATA_REJECT) {
LogInfo("[conn][%p] 0-RTT rejected", Connection);
QuicTraceLogConnInfo(ZeroRttRejected, Connection, "0-RTT rejected");
QUIC_TEL_ASSERT(Crypto->TlsState.EarlyDataAttempted);
QUIC_TEL_ASSERT(!Crypto->TlsState.EarlyDataAccepted);
if (!QuicConnIsServer(Connection)) {
@ -1103,7 +1097,7 @@ QuicCryptoProcessTlsCompletion(
}
if (ResultFlags & QUIC_TLS_RESULT_WRITE_KEY_UPDATED) {
EventWriteQuicConnWriteKeyUpdated(Connection, Crypto->TlsState.WriteKey);
QuicTraceEvent(ConnWriteKeyUpdated, Connection, Crypto->TlsState.WriteKey);
QUIC_DBG_ASSERT(Crypto->TlsState.WriteKey <= QUIC_PACKET_KEY_1_RTT);
_Analysis_assume_(Crypto->TlsState.WriteKey >= 0);
QUIC_TEL_ASSERT(Crypto->TlsState.WriteKeys[Crypto->TlsState.WriteKey] != NULL);
@ -1160,14 +1154,14 @@ QuicCryptoProcessTlsCompletion(
// at the previous encryption level.
//
if (QuicRecvBufferHasUnreadData(&Crypto->RecvBuffer)) {
EventWriteQuicConnError(
QuicTraceEvent(ConnError,
Connection, "Leftover crypto data in previous encryption level.");
QuicConnTransportError(Connection, QUIC_ERROR_PROTOCOL_VIOLATION);
return;
}
Crypto->RecvEncryptLevelStartOffset = Crypto->RecvTotalConsumed;
EventWriteQuicConnReadKeyUpdated(Connection, Crypto->TlsState.ReadKey);
QuicTraceEvent(ConnReadKeyUpdated, Connection, Crypto->TlsState.ReadKey);
//
// If we have the read key, we must also have the write key.
@ -1228,7 +1222,7 @@ QuicCryptoProcessTlsCompletion(
QUIC_DBG_ASSERT(!(ResultFlags & QUIC_TLS_RESULT_ERROR));
QUIC_TEL_ASSERT(!Connection->State.Connected);
EventWriteQuicConnHandshakeComplete(Connection);
QuicTraceEvent(ConnHandshakeComplete, Connection);
//
// We should have the 1-RTT keys by connection complete time.
@ -1270,8 +1264,8 @@ QuicCryptoProcessTlsCompletion(
QUIC_CONNECTION_EVENT Event;
Event.Type = QUIC_CONNECTION_EVENT_CONNECTED;
Event.CONNECTED.SessionResumed = Crypto->TlsState.SessionResumed;
LogVerbose("[conn][%p] Indicating QUIC_CONNECTION_EVENT_CONNECTED (Resume=%hu)",
Connection, Event.CONNECTED.SessionResumed);
QuicTraceLogConnVerbose(IndicateConnected, Connection, "Indicating QUIC_CONNECTION_EVENT_CONNECTED (Resume=%hu)",
Event.CONNECTED.SessionResumed);
(void)QuicConnIndicateEvent(Connection, &Event);
QuicSendSetSendFlag(&Connection->Send, QUIC_CONN_SEND_FLAG_PMTUD);
@ -1286,7 +1280,7 @@ QuicCryptoProcessTlsCompletion(
}
if (ResultFlags & QUIC_TLS_RESULT_TICKET) {
LogInfo("[conn][%p] Ticket ready", Connection);
QuicTraceLogConnInfo(TicketReady, Connection, "Ticket ready");
}
if (ResultFlags & QUIC_TLS_RESULT_READ_KEY_UPDATED) {
@ -1305,8 +1299,7 @@ QuicCryptoProcessDataComplete(
Crypto->TlsCallPending = FALSE;
if (RecvBufferConsumed != 0) {
Crypto->RecvTotalConsumed += RecvBufferConsumed;
LogVerbose("[cryp][%p] Draining %u crypto bytes.",
QuicCryptoGetConnection(Crypto), RecvBufferConsumed);
QuicTraceLogConnVerbose(DrainCrypto, QuicCryptoGetConnection(Crypto), "Draining %u crypto bytes.", RecvBufferConsumed);
QuicRecvBufferDrain(&Crypto->RecvBuffer, RecvBufferConsumed);
}
QuicCryptoProcessTlsCompletion(Crypto, ResultFlags);
@ -1326,7 +1319,7 @@ QuicTlsProcessDataCompleteCallback(
if ((Oper = QuicOperationAlloc(Connection->Worker, QUIC_OPER_TYPE_TLS_COMPLETE)) != NULL) {
QuicConnQueueOper(Connection, Oper);
} else {
EventWriteQuicAllocFailure("TLS complete operation", 0);
QuicTraceEvent(AllocFailure, "TLS complete operation", 0);
}
}
@ -1376,7 +1369,7 @@ QuicCryptoProcessData(
QuicCrytpoTlsGetCompleteTlsMessagesLength(
Buffer.Buffer, Buffer.Length);
if (Buffer.Length == 0) {
LogVerbose("[cryp][%p] No complete TLS messages to process.", Connection);
QuicTraceLogConnVerbose(CryptoNotReady, Connection, "No complete TLS messages to process.");
goto Error;
}
@ -1428,7 +1421,7 @@ QuicCryptoProcessData(
}
if (AcceptResult != QUIC_CONNECTION_ACCEPT) {
EventWriteQuicConnErrorStatus(
QuicTraceEvent(ConnErrorStatus,
Connection, AcceptResult, "Connection rejected.");
if (AcceptResult == QUIC_CONNECTION_REJECT_NO_LISTENER) {
QuicConnTransportError(
@ -1499,7 +1492,7 @@ QuicCryptoGenerateNewKeys(
Connection->Crypto.TlsState.ReadKeys[QUIC_PACKET_KEY_1_RTT],
NewReadKey);
if (QUIC_FAILED(Status)) {
EventWriteQuicConnErrorStatus(
QuicTraceEvent(ConnErrorStatus,
Connection, Status, "Failed to update read packet key.");
goto Error;
}
@ -1509,7 +1502,7 @@ QuicCryptoGenerateNewKeys(
Connection->Crypto.TlsState.WriteKeys[QUIC_PACKET_KEY_1_RTT],
NewWriteKey);
if (QUIC_FAILED(Status)) {
EventWriteQuicConnErrorStatus(
QuicTraceEvent(ConnErrorStatus,
Connection, Status, "Failed to update write packet key");
goto Error;
}
@ -1521,7 +1514,7 @@ Error:
QuicPacketKeyFree(*NewReadKey);
*NewReadKey = NULL;
} else {
EventWriteQuicConnNewPacketKeys(Connection);
QuicTraceEvent(ConnNewPacketKeys, Connection);
}
return Status;
@ -1590,7 +1583,7 @@ QuicCryptoUpdateKeyPhase(
QUIC_PACKET_SPACE* PacketSpace = Connection->Packets[QUIC_ENCRYPT_LEVEL_1_RTT];
EventWriteQuicConnKeyPhaseChange(Connection, LocalUpdate);
QuicTraceEvent(ConnKeyPhaseChange, Connection, LocalUpdate);
PacketSpace->WriteKeyPhaseStartPacketNumber = Connection->Send.NextPacketNumber;
PacketSpace->CurrentKeyPhase = !PacketSpace->CurrentKeyPhase;

Просмотреть файл

@ -166,7 +166,7 @@ QuicCryptoTlsReadSniExtension(
*/
if (BufferLength < sizeof(uint16_t)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsSni #1");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsSni #1");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -174,7 +174,7 @@ QuicCryptoTlsReadSniExtension(
// We need at least 3 bytes to encode NameType(1) and empty HostName(2)
//
if (TlsReadUint16(Buffer) < 3) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsSni #2");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsSni #2");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= sizeof(uint16_t);
@ -192,14 +192,14 @@ QuicCryptoTlsReadSniExtension(
Buffer++;
if (BufferLength < sizeof(uint16_t)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsSni #3");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsSni #3");
return QUIC_STATUS_INVALID_PARAMETER;
}
uint16_t NameLen = TlsReadUint16(Buffer);
BufferLength -= 2;
Buffer += 2;
if (BufferLength < NameLen) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsSni #4");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsSni #4");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -247,11 +247,11 @@ QuicCryptoTlsReadAlpnExtension(
// 2 bytes for protocol ID list size.
//
if (BufferLength < sizeof(uint16_t) + 2 * sizeof(uint8_t)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsAlpn #1");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsAlpn #1");
return QUIC_STATUS_INVALID_PARAMETER;
}
if (BufferLength != TlsReadUint16(Buffer) + sizeof(uint16_t)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsAlpn #2");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsAlpn #2");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= sizeof(uint16_t);
@ -271,7 +271,7 @@ QuicCryptoTlsReadAlpnExtension(
if (BufferLength < 1 ||
BufferLength < Len) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsAlpn #3");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsAlpn #3");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -311,7 +311,7 @@ QuicCryptoTlsReadExtensions(
// the extension type and 2 for the length.
//
if (BufferLength < 2 * sizeof(uint16_t)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsExt #1");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsExt #1");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -320,7 +320,7 @@ QuicCryptoTlsReadExtensions(
BufferLength -= 2 * sizeof(uint16_t);
Buffer += 2 * sizeof(uint16_t);
if (BufferLength < ExtLen) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsExt #2");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsExt #2");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -379,7 +379,7 @@ QuicCryptoTlsReadClientHello(
//
if (BufferLength < sizeof(uint16_t) ||
TlsReadUint16(Buffer) < TLS1_PROTOCOL_VERSION) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #1");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #1");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= sizeof(uint16_t);
@ -389,7 +389,7 @@ QuicCryptoTlsReadClientHello(
// Random
//
if (BufferLength < TLS_RANDOM_LENGTH) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #2");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #2");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= TLS_RANDOM_LENGTH;
@ -401,7 +401,7 @@ QuicCryptoTlsReadClientHello(
if (BufferLength < sizeof(uint8_t) ||
Buffer[0] > TLS_SESSION_ID_LENGTH ||
BufferLength < sizeof(uint8_t) + Buffer[0]) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #3");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #3");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= sizeof(uint8_t) + Buffer[0];
@ -411,12 +411,12 @@ QuicCryptoTlsReadClientHello(
// CipherSuite
//
if (BufferLength < sizeof(uint16_t)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #4");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #4");
return QUIC_STATUS_INVALID_PARAMETER;
}
uint16_t Len = TlsReadUint16(Buffer);
if ((Len % 2) || BufferLength < (uint32_t)(sizeof(uint16_t) + Len)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #5");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #5");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= sizeof(uint16_t) + Len;
@ -428,7 +428,7 @@ QuicCryptoTlsReadClientHello(
if (BufferLength < sizeof(uint8_t) ||
Buffer[0] < 1 ||
BufferLength < sizeof(uint8_t) + Buffer[0]) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #6");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #6");
return QUIC_STATUS_INVALID_PARAMETER;
}
BufferLength -= sizeof(uint8_t) + Buffer[0];
@ -442,7 +442,7 @@ QuicCryptoTlsReadClientHello(
}
Len = TlsReadUint16(Buffer);
if (BufferLength < (uint32_t)(sizeof(uint16_t) + Len)) {
EventWriteQuicConnError(Connection, "Parse error. ReadTlsClientHello #7");
QuicTraceEvent(ConnError, Connection, "Parse error. ReadTlsClientHello #7");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -500,7 +500,7 @@ QuicCryptoTlsReadInitial(
}
if (Buffer[0] != TlsHandshake_ClientHello) {
EventWriteQuicConnError(Connection, "Invalid message in TlsReadInitial");
QuicTraceEvent(ConnError, Connection, "Invalid message in TlsReadInitial");
return QUIC_STATUS_INVALID_PARAMETER;
}
@ -525,12 +525,12 @@ QuicCryptoTlsReadInitial(
} while (BufferLength > 0);
if (Info->AlpnList == NULL) {
EventWriteQuicConnError(Connection, "No ALPN list extension present");
QuicTraceEvent(ConnError, Connection, "No ALPN list extension present");
return QUIC_STATUS_INVALID_PARAMETER;
}
if (Info->ServerName == NULL) {
LogWarning("[cryp][%p] No SNI extension present.", Connection);
QuicTraceLogConnWarning(NoSniPresent, Connection, "No SNI extension present.");
}
return QUIC_STATUS_SUCCESS;
@ -549,7 +549,7 @@ QuicCryptoTlsEncodeTransportParameters(
// Precompute the required size so we can allocate all at once.
//
LogVerbose("[cryp][%p] Encoding Transport Parameters", Connection);
QuicTraceLogConnVerbose(EncodeTPStart, Connection, "Encoding Transport Parameters");
size_t RequiredTPLen = sizeof(uint16_t); // Parameter list length
if (TransportParams->Flags & QUIC_TP_FLAG_ORIGINAL_CONNECTION_ID) {
@ -607,14 +607,13 @@ QuicCryptoTlsEncodeTransportParameters(
QUIC_TEL_ASSERT(RequiredTPLen <= UINT16_MAX);
if (RequiredTPLen > UINT16_MAX) {
LogWarning("[cryp][%p] Encoding TP too big! 0x%u",
Connection, (uint32_t)RequiredTPLen);
QuicTraceEvent(ConnError, Connection, "Encoding TP too big.");
return NULL;
}
uint8_t* TPBufBase = QUIC_ALLOC_NONPAGED(QuicTlsTPHeaderSize + RequiredTPLen);
if (TPBufBase == NULL) {
EventWriteQuicAllocFailure("TP buffer", QuicTlsTPHeaderSize + RequiredTPLen);
QuicTraceEvent(AllocFailure, "TP buffer", QuicTlsTPHeaderSize + RequiredTPLen);
return NULL;
}
@ -637,14 +636,14 @@ QuicCryptoTlsEncodeTransportParameters(
TransportParams->OriginalConnectionIDLength,
TransportParams->OriginalConnectionID,
TPBuf);
LogVerbose("[cryp][%p] TP: Original Connection ID", Connection);
QuicTraceLogConnVerbose(EncodeTPOriginalCID, Connection, "TP: Original Connection ID");
}
if (TransportParams->Flags & QUIC_TP_FLAG_IDLE_TIMEOUT) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_IDLE_TIMEOUT,
TransportParams->IdleTimeout, TPBuf);
LogVerbose("[cryp][%p] TP: Idle Timeout (%llu ms)", Connection, TransportParams->IdleTimeout);
QuicTraceLogConnVerbose(EncodeTPIdleTimeout, Connection, "TP: Idle Timeout (%llu ms)", TransportParams->IdleTimeout);
}
if (TransportParams->Flags & QUIC_TP_FLAG_STATELESS_RESET_TOKEN) {
QUIC_DBG_ASSERT(QuicConnIsServer(Connection));
@ -654,7 +653,7 @@ QuicCryptoTlsEncodeTransportParameters(
QUIC_STATELESS_RESET_TOKEN_LENGTH,
TransportParams->StatelessResetToken,
TPBuf);
LogVerbose("[cryp][%p] TP: Stateless Reset Token (%s)", Connection,
QuicTraceLogConnVerbose(EncodeTPStatelessResetToken, Connection, "TP: Stateless Reset Token (%s)",
QuicCidBufToStr(
TransportParams->StatelessResetToken,
QUIC_STATELESS_RESET_TOKEN_LENGTH).Buffer);
@ -664,63 +663,63 @@ QuicCryptoTlsEncodeTransportParameters(
TlsWriteTransportParamVarInt(
QUIC_TP_ID_MAX_PACKET_SIZE,
TransportParams->MaxPacketSize, TPBuf);
LogVerbose("[cryp][%p] TP: Max Packet Size (%llu bytes)", Connection, TransportParams->MaxPacketSize);
QuicTraceLogConnVerbose(EncodeTPMaxPacketSize, Connection, "TP: Max Packet Size (%llu bytes)", TransportParams->MaxPacketSize);
}
if (TransportParams->Flags & QUIC_TP_FLAG_INITIAL_MAX_DATA) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_INITIAL_MAX_DATA,
TransportParams->InitialMaxData, TPBuf);
LogVerbose("[cryp][%p] TP: Max Data (%llu bytes)", Connection, TransportParams->InitialMaxData);
QuicTraceLogConnVerbose(EncodeTPInitMaxData, Connection, "TP: Max Data (%llu bytes)", TransportParams->InitialMaxData);
}
if (TransportParams->Flags & QUIC_TP_FLAG_INITIAL_MAX_STRM_DATA_BIDI_LOCAL) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL,
TransportParams->InitialMaxStreamDataBidiLocal, TPBuf);
LogVerbose("[cryp][%p] TP: Max Local Bidirectional Stream Data (%llu bytes)", Connection, TransportParams->InitialMaxStreamDataBidiLocal);
QuicTraceLogConnVerbose(EncodeTPInitMaxStreamDataBidiLocal, Connection, "TP: Max Local Bidirectional Stream Data (%llu bytes)", TransportParams->InitialMaxStreamDataBidiLocal);
}
if (TransportParams->Flags & QUIC_TP_FLAG_INITIAL_MAX_STRM_DATA_BIDI_REMOTE) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE,
TransportParams->InitialMaxStreamDataBidiRemote, TPBuf);
LogVerbose("[cryp][%p] TP: Max Remote Bidirectional Stream Data (%llu bytes)", Connection, TransportParams->InitialMaxStreamDataBidiRemote);
QuicTraceLogConnVerbose(EncodeTPInitMaxStreamDataBidiRemote, Connection, "TP: Max Remote Bidirectional Stream Data (%llu bytes)", TransportParams->InitialMaxStreamDataBidiRemote);
}
if (TransportParams->Flags & QUIC_TP_FLAG_INITIAL_MAX_STRM_DATA_UNI) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_UNI,
TransportParams->InitialMaxStreamDataUni, TPBuf);
LogVerbose("[cryp][%p] TP: Max Unidirectional Stream Data (%llu)", Connection, TransportParams->InitialMaxStreamDataUni);
QuicTraceLogConnVerbose(EncodeTPInitMaxStreamUni, Connection, "TP: Max Unidirectional Stream Data (%llu)", TransportParams->InitialMaxStreamDataUni);
}
if (TransportParams->Flags & QUIC_TP_FLAG_INITIAL_MAX_STRMS_BIDI) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_INITIAL_MAX_STREAMS_BIDI,
TransportParams->InitialMaxBidiStreams, TPBuf);
LogVerbose("[cryp][%p] TP: Max Bidirectional Streams (%llu)", Connection, TransportParams->InitialMaxBidiStreams);
QuicTraceLogConnVerbose(EncodeTPMaxBidiStreams, Connection, "TP: Max Bidirectional Streams (%llu)", TransportParams->InitialMaxBidiStreams);
}
if (TransportParams->Flags & QUIC_TP_FLAG_INITIAL_MAX_STRMS_UNI) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_INITIAL_MAX_STREAMS_UNI,
TransportParams->InitialMaxUniStreams, TPBuf);
LogVerbose("[cryp][%p] TP: Max Unidirectional Streams (%llu)", Connection, TransportParams->InitialMaxUniStreams);
QuicTraceLogConnVerbose(EncodeTPMaxUniStreams, Connection, "TP: Max Unidirectional Streams (%llu)", TransportParams->InitialMaxUniStreams);
}
if (TransportParams->Flags & QUIC_TP_FLAG_ACK_DELAY_EXPONENT) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_ACK_DELAY_EXPONENT,
TransportParams->AckDelayExponent, TPBuf);
LogVerbose("[cryp][%p] TP: ACK Delay Exponent (%llu)", Connection, TransportParams->AckDelayExponent);
QuicTraceLogConnVerbose(EncodeTPAckDelayExponent, Connection, "TP: ACK Delay Exponent (%llu)", TransportParams->AckDelayExponent);
}
if (TransportParams->Flags & QUIC_TP_FLAG_MAX_ACK_DELAY) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_MAX_ACK_DELAY,
TransportParams->MaxAckDelay, TPBuf);
LogVerbose("[cryp][%p] TP: Max ACK Delay (%llu ms)", Connection, TransportParams->MaxAckDelay);
QuicTraceLogConnVerbose(EncodeTPMaxAckDelay, Connection, "TP: Max ACK Delay (%llu ms)", TransportParams->MaxAckDelay);
}
if (TransportParams->Flags & QUIC_TP_FLAG_DISABLE_ACTIVE_MIGRATION) {
TPBuf =
@ -729,19 +728,19 @@ QuicCryptoTlsEncodeTransportParameters(
0,
NULL,
TPBuf);
LogVerbose("[cryp][%p] TP: Disable Active Migration", Connection);
QuicTraceLogConnVerbose(EncodeTPDisableMigration, Connection, "TP: Disable Active Migration");
}
if (TransportParams->Flags & QUIC_TP_FLAG_PREFERRED_ADDRESS) {
QUIC_DBG_ASSERT(QuicConnIsServer(Connection));
QUIC_FRE_ASSERT(FALSE); // TODO - Implement
LogVerbose("[cryp][%p] TP: Preferred Address", Connection);
QuicTraceLogConnVerbose(EncodeTPPreferredAddress, Connection, "TP: Preferred Address");
}
if (TransportParams->Flags & QUIC_TP_FLAG_ACTIVE_CONNECTION_ID_LIMIT) {
TPBuf =
TlsWriteTransportParamVarInt(
QUIC_TP_ID_ACTIVE_CONNECTION_ID_LIMIT,
TransportParams->ActiveConnectionIdLimit, TPBuf);
LogVerbose("[cryp][%p] TP: Connection ID Limit (%llu)", Connection, TransportParams->ActiveConnectionIdLimit);
QuicTraceLogConnVerbose(EncodeTPCIDLimit, Connection, "TP: Connection ID Limit (%llu)", TransportParams->ActiveConnectionIdLimit);
}
if (Connection->State.TestTransportParameterSet) {
TPBuf =
@ -750,21 +749,19 @@ QuicCryptoTlsEncodeTransportParameters(
Connection->TestTransportParameter.Length,
Connection->TestTransportParameter.Buffer,
TPBuf);
LogVerbose("[cryp][%p] TP: TEST TP (Type %hu, Length %hu)", Connection,
QuicTraceLogConnVerbose(EncodeTPTest, Connection, "TP: TEST TP (Type %hu, Length %hu)",
Connection->TestTransportParameter.Type,
Connection->TestTransportParameter.Length);
}
size_t FinalTPLength = (TPBuf - (TPBufBase + QuicTlsTPHeaderSize));
if (FinalTPLength != RequiredTPLen) {
LogWarning("[cryp][%p] Encoding error! Length mismatch, %hu vs %hu",
Connection, (uint16_t)FinalTPLength, (uint16_t)RequiredTPLen);
QuicTraceEvent(ConnError, Connection, "Encoding error! Length mismatch.");
QUIC_TEL_ASSERT(FinalTPLength == RequiredTPLen);
QUIC_FREE(TPBufBase);
return NULL;
} else {
LogVerbose("[cryp][%p] Encoded %hu bytes for QUIC TP",
Connection, (uint16_t)FinalTPLength);
QuicTraceLogConnVerbose(EncodeTPEnd, Connection, "Encoded %hu bytes for QUIC TP", (uint16_t)FinalTPLength);
}
return TPBufBase;
@ -790,17 +787,17 @@ QuicCryptoTlsDecodeTransportParameters(
TransportParams->AckDelayExponent = QUIC_DEFAULT_ACK_DELAY_EXPONENT;
TransportParams->MaxAckDelay = QUIC_TP_MAX_ACK_DELAY_DEFAULT;
LogVerbose("[cryp][%p] Decoding Peer Transport Parameters (%hu bytes)", Connection, TPLen);
QuicTraceLogConnVerbose(DecodeTPStart, Connection, "Decoding Peer Transport Parameters (%hu bytes)", TPLen);
if (TPLen < sizeof(uint16_t)) {
EventWriteQuicConnError(Connection, "Invalid length for QUIC TP param list length");
QuicTraceEvent(ConnError, Connection, "Invalid length for QUIC TP param list length");
goto Exit;
}
uint16_t TPParamListLen = QuicByteSwapUint16(*(uint16_t*)(TPBuf));
Offset += sizeof(uint16_t);
if (Offset + TPParamListLen > TPLen) {
EventWriteQuicConnError(Connection, "QUIC TP param list length too large");
QuicTraceEvent(ConnError, Connection, "QUIC TP param list length too large");
goto Exit;
}
@ -810,7 +807,7 @@ QuicCryptoTlsDecodeTransportParameters(
// Validate there is enough space to read the next ID and length.
//
if (Offset + TLS_HDR_SIZE > TPLen) {
EventWriteQuicConnError(Connection, "QUIC TP params invalid leftover length");
QuicTraceEvent(ConnError, Connection, "QUIC TP params invalid leftover length");
goto Exit;
}
@ -823,7 +820,7 @@ QuicCryptoTlsDecodeTransportParameters(
if (Id <= QUIC_TP_ID_MAX) {
if (ParamsPresent & (1 << Id)) {
EventWriteQuicConnErrorStatus(Connection, Id, "Duplicate QUIC TP type");
QuicTraceEvent(ConnErrorStatus, Connection, Id, "Duplicate QUIC TP type");
goto Exit;
}
@ -840,7 +837,7 @@ QuicCryptoTlsDecodeTransportParameters(
// Validate there is enough space for the actual value to be read.
//
if (Offset + Length > TPLen) {
EventWriteQuicConnErrorStatus(Connection, Id, "QUIC TP value length too long");
QuicTraceEvent(ConnErrorStatus, Connection, Id, "QUIC TP value length too long");
goto Exit;
}
@ -852,10 +849,10 @@ QuicCryptoTlsDecodeTransportParameters(
case QUIC_TP_ID_ORIGINAL_CONNECTION_ID:
if (Length > QUIC_MAX_CONNECTION_ID_LENGTH_V1) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_ORIGINAL_CONNECTION_ID");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_ORIGINAL_CONNECTION_ID");
goto Exit;
} else if (QuicConnIsServer(Connection)) {
EventWriteQuicConnError(Connection, "Client incorrectly provided original connection ID");
QuicTraceEvent(ConnError, Connection, "Client incorrectly provided original connection ID");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_ORIGINAL_CONNECTION_ID;
@ -864,24 +861,24 @@ QuicCryptoTlsDecodeTransportParameters(
TransportParams->OriginalConnectionID,
TPBuf + Offset,
Length);
LogVerbose("[cryp][%p] TP: Original Connection ID", Connection);
QuicTraceLogConnVerbose(DecodeTPOriginalCID, Connection, "TP: Original Connection ID");
break;
case QUIC_TP_ID_IDLE_TIMEOUT:
if (!TRY_READ_VAR_INT(TransportParams->IdleTimeout)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_ORIGINAL_CONNECTION_ID");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_ORIGINAL_CONNECTION_ID");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_IDLE_TIMEOUT;
LogVerbose("[cryp][%p] TP: Idle Timeout (%llu ms)", Connection, TransportParams->IdleTimeout);
QuicTraceLogConnVerbose(DecodeTPIdleTimeout, Connection, "TP: Idle Timeout (%llu ms)", TransportParams->IdleTimeout);
break;
case QUIC_TP_ID_STATELESS_RESET_TOKEN:
if (Length != QUIC_STATELESS_RESET_TOKEN_LENGTH) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_ORIGINAL_CONNECTION_ID");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_ORIGINAL_CONNECTION_ID");
goto Exit;
} else if (QuicConnIsServer(Connection)) {
EventWriteQuicConnError(Connection, "Client incorrectly provided stateless reset token");
QuicTraceEvent(ConnError, Connection, "Client incorrectly provided stateless reset token");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_STATELESS_RESET_TOKEN;
@ -889,7 +886,7 @@ QuicCryptoTlsDecodeTransportParameters(
TransportParams->StatelessResetToken,
TPBuf + Offset,
QUIC_STATELESS_RESET_TOKEN_LENGTH);
LogVerbose("[cryp][%p] TP: Stateless Reset Token (%s)", Connection,
QuicTraceLogConnVerbose(DecodeTPStatelessResetToken, Connection, "TP: Stateless Reset Token (%s)",
QuicCidBufToStr(
TransportParams->StatelessResetToken,
QUIC_STATELESS_RESET_TOKEN_LENGTH).Buffer);
@ -897,147 +894,145 @@ QuicCryptoTlsDecodeTransportParameters(
case QUIC_TP_ID_MAX_PACKET_SIZE:
if (!TRY_READ_VAR_INT(TransportParams->MaxPacketSize)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_MAX_PACKET_SIZE");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_MAX_PACKET_SIZE");
goto Exit;
}
if (TransportParams->MaxPacketSize < QUIC_TP_MAX_PACKET_SIZE_MIN) {
EventWriteQuicConnError(Connection, "TP MaxPacketSize too small");
QuicTraceEvent(ConnError, Connection, "TP MaxPacketSize too small");
goto Exit;
}
if (TransportParams->MaxPacketSize > QUIC_TP_MAX_PACKET_SIZE_MAX) {
EventWriteQuicConnError(Connection, "TP MaxPacketSize too big");
QuicTraceEvent(ConnError, Connection, "TP MaxPacketSize too big");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_MAX_PACKET_SIZE;
LogVerbose("[cryp][%p] TP: Max Packet Size (%llu bytes)", Connection, TransportParams->MaxPacketSize);
QuicTraceLogConnVerbose(DecodeTPMaxPacketSize, Connection, "TP: Max Packet Size (%llu bytes)", TransportParams->MaxPacketSize);
break;
case QUIC_TP_ID_INITIAL_MAX_DATA:
if (!TRY_READ_VAR_INT(TransportParams->InitialMaxData)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_DATA");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_DATA");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_INITIAL_MAX_DATA;
LogVerbose("[cryp][%p] TP: Max Data (%llu bytes)", Connection, TransportParams->InitialMaxData);
QuicTraceLogConnVerbose(DecodeTPInitMaxData, Connection, "TP: Max Data (%llu bytes)", TransportParams->InitialMaxData);
break;
case QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL:
if (!TRY_READ_VAR_INT(TransportParams->InitialMaxStreamDataBidiLocal)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL");
goto Exit;
}
if (TransportParams->InitialMaxStreamDataBidiLocal > QUIC_TP_MAX_MAX_STREAMS) {
EventWriteQuicConnError(Connection, "TP InitialMaxStreamDataBidiLocal too big");
QuicTraceEvent(ConnError, Connection, "TP InitialMaxStreamDataBidiLocal too big");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_INITIAL_MAX_STRM_DATA_BIDI_LOCAL;
LogVerbose("[cryp][%p] TP: Max Local Bidirectional Stream Data (%llu bytes)", Connection, TransportParams->InitialMaxStreamDataBidiLocal);
QuicTraceLogConnVerbose(DecodeTPInitMaxStreamDataBidiLocal, Connection, "TP: Max Local Bidirectional Stream Data (%llu bytes)", TransportParams->InitialMaxStreamDataBidiLocal);
break;
case QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE:
if (!TRY_READ_VAR_INT(TransportParams->InitialMaxStreamDataBidiRemote)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE");
goto Exit;
}
if (TransportParams->InitialMaxStreamDataBidiRemote > QUIC_TP_MAX_MAX_STREAMS) {
EventWriteQuicConnError(Connection, "TP InitialMaxStreamDataBidiRemote too big");
QuicTraceEvent(ConnError, Connection, "TP InitialMaxStreamDataBidiRemote too big");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_INITIAL_MAX_STRM_DATA_BIDI_REMOTE;
LogVerbose("[cryp][%p] TP: Max Remote Bidirectional Stream Data (%llu bytes)", Connection, TransportParams->InitialMaxStreamDataBidiRemote);
QuicTraceLogConnVerbose(DecodeTPInitMaxStreamDataBidiRemote, Connection, "TP: Max Remote Bidirectional Stream Data (%llu bytes)", TransportParams->InitialMaxStreamDataBidiRemote);
break;
case QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_UNI:
if (!TRY_READ_VAR_INT(TransportParams->InitialMaxStreamDataUni)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_UNI");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAM_DATA_UNI");
goto Exit;
}
if (TransportParams->InitialMaxStreamDataUni > QUIC_TP_MAX_MAX_STREAMS) {
EventWriteQuicConnError(Connection, "TP InitialMaxStreamDataUni too big");
QuicTraceEvent(ConnError, Connection, "TP InitialMaxStreamDataUni too big");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_INITIAL_MAX_STRM_DATA_UNI;
LogVerbose("[cryp][%p] TP: Max Unidirectional Stream Data (%llu)", Connection, TransportParams->InitialMaxStreamDataUni);
QuicTraceLogConnVerbose(DecodeTPInitMaxStreamDataBidiUni, Connection, "TP: Max Unidirectional Stream Data (%llu)", TransportParams->InitialMaxStreamDataUni);
break;
case QUIC_TP_ID_INITIAL_MAX_STREAMS_BIDI:
if (!TRY_READ_VAR_INT(TransportParams->InitialMaxBidiStreams)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAMS_BIDI");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAMS_BIDI");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_INITIAL_MAX_STRMS_BIDI;
LogVerbose("[cryp][%p] TP: Max Bidirectional Streams (%llu)", Connection, TransportParams->InitialMaxBidiStreams);
QuicTraceLogConnVerbose(DecodeTPMaxBidiStreams, Connection, "TP: Max Bidirectional Streams (%llu)", TransportParams->InitialMaxBidiStreams);
break;
case QUIC_TP_ID_INITIAL_MAX_STREAMS_UNI:
if (!TRY_READ_VAR_INT(TransportParams->InitialMaxUniStreams)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAMS_UNI");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_INITIAL_MAX_STREAMS_UNI");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_INITIAL_MAX_STRMS_UNI;
LogVerbose("[cryp][%p] TP: Max Unidirectional Streams (%llu)", Connection, TransportParams->InitialMaxUniStreams);
QuicTraceLogConnVerbose(DecodeTPMaxUniStreams, Connection, "TP: Max Unidirectional Streams (%llu)", TransportParams->InitialMaxUniStreams);
break;
case QUIC_TP_ID_ACK_DELAY_EXPONENT:
if (!TRY_READ_VAR_INT(TransportParams->AckDelayExponent)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_MAX_ACK_DELAY_EXPONENT");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_MAX_ACK_DELAY_EXPONENT");
goto Exit;
}
if (TransportParams->AckDelayExponent > QUIC_TP_MAX_ACK_DELAY_EXPONENT) {
EventWriteQuicConnError(Connection, "Invalid value of QUIC_TP_MAX_ACK_DELAY_EXPONENT");
QuicTraceEvent(ConnError, Connection, "Invalid value of QUIC_TP_MAX_ACK_DELAY_EXPONENT");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_ACK_DELAY_EXPONENT;
LogVerbose("[cryp][%p] TP: ACK Delay Exponent (%llu)", Connection, TransportParams->AckDelayExponent);
QuicTraceLogConnVerbose(DecodeTPAckDelayExponent, Connection, "TP: ACK Delay Exponent (%llu)", TransportParams->AckDelayExponent);
break;
case QUIC_TP_ID_MAX_ACK_DELAY:
if (!TRY_READ_VAR_INT(TransportParams->MaxAckDelay)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_MAX_MAX_ACK_DELAY");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_MAX_MAX_ACK_DELAY");
goto Exit;
}
if (TransportParams->MaxAckDelay > QUIC_TP_MAX_MAX_ACK_DELAY) {
EventWriteQuicConnError(Connection, "Invalid value of QUIC_TP_MAX_MAX_ACK_DELAY");
QuicTraceEvent(ConnError, Connection, "Invalid value of QUIC_TP_MAX_MAX_ACK_DELAY");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_MAX_ACK_DELAY;
LogVerbose("[cryp][%p] TP: Max ACK Delay (%llu ms)", Connection, TransportParams->MaxAckDelay);
QuicTraceLogConnVerbose(DecodeTPMaxAckDelay, Connection, "TP: Max ACK Delay (%llu ms)", TransportParams->MaxAckDelay);
break;
case QUIC_TP_ID_DISABLE_ACTIVE_MIGRATION:
if (Length != 0) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_DISABLE_ACTIVE_MIGRATION");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_DISABLE_ACTIVE_MIGRATION");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_DISABLE_ACTIVE_MIGRATION;
LogVerbose("[cryp][%p] TP: Disable Active Migration", Connection);
QuicTraceLogConnVerbose(DecodeTPDisableActiveMigration, Connection, "TP: Disable Active Migration");
break;
case QUIC_TP_ID_PREFERRED_ADDRESS:
if (QuicConnIsServer(Connection)) {
EventWriteQuicConnError(Connection, "Client incorrectly provided preferred address");
QuicTraceEvent(ConnError, Connection, "Client incorrectly provided preferred address");
goto Exit;
}
LogVerbose("[cryp][%p] TP: Preferred Address", Connection);
QuicTraceLogConnVerbose(DecodeTPPreferredAddress, Connection, "TP: Preferred Address");
// TODO - Implement
break;
case QUIC_TP_ID_ACTIVE_CONNECTION_ID_LIMIT:
if (!TRY_READ_VAR_INT(TransportParams->ActiveConnectionIdLimit)) {
EventWriteQuicConnErrorStatus(Connection, Length, "Invalid length of QUIC_TP_ID_ACTIVE_CONNECTION_ID_LIMIT");
QuicTraceEvent(ConnErrorStatus, Connection, Length, "Invalid length of QUIC_TP_ID_ACTIVE_CONNECTION_ID_LIMIT");
goto Exit;
}
TransportParams->Flags |= QUIC_TP_FLAG_ACTIVE_CONNECTION_ID_LIMIT;
LogVerbose("[cryp][%p] TP: Connection ID Limit (%llu)", Connection, TransportParams->ActiveConnectionIdLimit);
QuicTraceLogConnVerbose(DecodeTPCIDLimit, Connection, "TP: Connection ID Limit (%llu)", TransportParams->ActiveConnectionIdLimit);
break;
default:
if (QuicTpIdIsReserved(Id)) {
LogWarning("[cryp][%p] TP: Reserved ID %hu, length %hu",
Connection, Id, Length);
QuicTraceLogConnWarning(DecodeTPReserved, Connection, "TP: Reserved ID %hu, length %hu", Id, Length);
} else {
LogWarning("[cryp][%p] TP: Unknown ID %hu, length %hu",
Connection, Id, Length);
QuicTraceLogConnWarning(DecodeTPUnknown, Connection, "TP: Unknown ID %hu, length %hu", Id, Length);
}
break;
}

Просмотреть файл

@ -1138,7 +1138,7 @@ QuicFrameLog(
{
QUIC_FRAME_TYPE FrameType = Packet[*Offset];
if (FrameType > MAX_QUIC_FRAME) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] unknown frame (%hu)",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, FrameType);
return FALSE;
@ -1154,14 +1154,14 @@ QuicFrameLog(
Packet[*Offset] == QUIC_FRAME_PADDING) {
(*Offset) += sizeof(uint8_t);
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] PADDING Len:%hu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, (*Offset - Start) + 1);
break;
}
case QUIC_FRAME_PING: {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] PING",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
break;
@ -1171,24 +1171,24 @@ QuicFrameLog(
case QUIC_FRAME_ACK_1: {
QUIC_ACK_EX Frame;
if (!QuicAckHeaderDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] ACK [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] ACK Largest:%llu Delay:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.LargestAcknowledged,
Frame.AckDelay);
if (Frame.FirstAckBlock == 0) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] %llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber,
Frame.LargestAcknowledged);
} else {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] %llu - %llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber,
Frame.LargestAcknowledged - Frame.FirstAckBlock,
@ -1200,7 +1200,7 @@ QuicFrameLog(
for (uint8_t i = 0; i < Frame.AdditionalAckBlockCount; i++) {
QUIC_ACK_BLOCK_EX Block;
if (!QuicAckBlockDecode(PacketLength, Packet, Offset, &Block)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] [Invalid Block]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
@ -1209,12 +1209,12 @@ QuicFrameLog(
Frame.LargestAcknowledged -= (Block.Gap + 1);
if (Block.AckBlock == 0) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] %llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber,
Frame.LargestAcknowledged);
} else {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] %llu - %llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber,
Frame.LargestAcknowledged - Block.AckBlock,
@ -1229,12 +1229,12 @@ QuicFrameLog(
if (!QuicVarIntDecode(PacketLength, Packet, Offset, &Ecn.ECT_0_Count) ||
!QuicVarIntDecode(PacketLength, Packet, Offset, &Ecn.ECT_1_Count) ||
!QuicVarIntDecode(PacketLength, Packet, Offset, &Ecn.CE_Count)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] ECN [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] ECN [ECT0=%llu,ECT1=%llu,CE=%llu]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber,
Ecn.ECT_0_Count, Ecn.ECT_1_Count, Ecn.CE_Count);
@ -1246,13 +1246,13 @@ QuicFrameLog(
case QUIC_FRAME_RESET_STREAM: {
QUIC_RESET_STREAM_EX Frame;
if (!QuicResetStreamFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] RESET_STREAM [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] RESET_STREAM ID:%llu ErrorCode:0x%llX FinalSize:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.StreamID, Frame.ErrorCode,
Frame.FinalSize);
@ -1262,13 +1262,13 @@ QuicFrameLog(
case QUIC_FRAME_STOP_SENDING: {
QUIC_STOP_SENDING_EX Frame;
if (!QuicStopSendingFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STOP_SENDING [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STOP_SENDING ID:%llu Error:0x%llX",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.StreamID, Frame.ErrorCode);
break;
@ -1277,13 +1277,13 @@ QuicFrameLog(
case QUIC_FRAME_CRYPTO: {
QUIC_CRYPTO_EX Frame;
if (!QuicCryptoFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] CRYPTO [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] CRYPTO Offset:%llu Len:%hu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.Offset, (uint16_t)Frame.Length);
@ -1293,13 +1293,13 @@ QuicFrameLog(
case QUIC_FRAME_NEW_TOKEN: {
QUIC_NEW_TOKEN_EX Frame;
if (!QuicNewTokenFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] NEW_TOKEN [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] NEW_TOKEN Length:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.TokenLength);
@ -1316,19 +1316,19 @@ QuicFrameLog(
case QUIC_FRAME_STREAM_7: {
QUIC_STREAM_EX Frame;
if (!QuicStreamFrameDecode(FrameType, PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAM [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
if (Frame.Fin) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAM ID:%llu Offset:%llu Len:%hu Fin",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.StreamID, Frame.Offset,
(uint16_t)Frame.Length);
} else {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAM ID:%llu Offset:%llu Len:%hu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.StreamID, Frame.Offset,
(uint16_t)Frame.Length);
@ -1340,13 +1340,13 @@ QuicFrameLog(
case QUIC_FRAME_MAX_DATA: {
QUIC_MAX_DATA_EX Frame;
if (!QuicMaxDataFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] MAX_DATA [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] MAX_DATA Max:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.MaximumData);
break;
@ -1355,13 +1355,13 @@ QuicFrameLog(
case QUIC_FRAME_MAX_STREAM_DATA: {
QUIC_MAX_STREAM_DATA_EX Frame;
if (!QuicMaxStreamDataFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] MAX_STREAM_DATA [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] MAX_STREAM_DATA ID:%llu Max:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.StreamID, Frame.MaximumData);
break;
@ -1371,13 +1371,13 @@ QuicFrameLog(
case QUIC_FRAME_MAX_STREAMS_1: {
QUIC_MAX_STREAMS_EX Frame;
if (!QuicMaxStreamsFrameDecode(FrameType, PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] MAX_STREAMS [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] MAX_STREAMS[%hu] Count:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.BidirectionalStreams, Frame.MaximumStreams);
break;
@ -1386,12 +1386,12 @@ QuicFrameLog(
case QUIC_FRAME_DATA_BLOCKED: {
QUIC_DATA_BLOCKED_EX Frame;
if (!QuicDataBlockedFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] DATA_BLOCKED [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] DATA_BLOCKED Limit:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.DataLimit);
break;
@ -1400,13 +1400,13 @@ QuicFrameLog(
case QUIC_FRAME_STREAM_DATA_BLOCKED: {
QUIC_STREAM_DATA_BLOCKED_EX Frame;
if (!QuicStreamDataBlockedFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAM_DATA_BLOCKED [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAM_DATA_BLOCKED ID:%llu Limit:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.StreamID, Frame.StreamDataLimit);
break;
@ -1416,13 +1416,13 @@ QuicFrameLog(
case QUIC_FRAME_STREAMS_BLOCKED_1: {
QUIC_STREAMS_BLOCKED_EX Frame;
if (!QuicStreamsBlockedFrameDecode(FrameType, PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAMS_BLOCKED [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] STREAMS_BLOCKED[%hu] ID:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.BidirectionalStreams, Frame.StreamLimit);
break;
@ -1431,13 +1431,13 @@ QuicFrameLog(
case QUIC_FRAME_NEW_CONNECTION_ID: {
QUIC_NEW_CONNECTION_ID_EX Frame;
if (!QuicNewConnectionIDFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] NEW_CONN_ID [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] NEW_CONN_ID Seq:%llu CID:%s Token:%s",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.Sequence,
QuicCidBufToStr(Frame.Buffer, Frame.Length).Buffer,
@ -1448,13 +1448,13 @@ QuicFrameLog(
case QUIC_FRAME_RETIRE_CONNECTION_ID: {
QUIC_RETIRE_CONNECTION_ID_EX Frame;
if (!QuicRetireConnectionIDFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] RETIRE_CONN_ID [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] RETIRE_CONN_ID Seq:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.Sequence);
break;
@ -1463,13 +1463,13 @@ QuicFrameLog(
case QUIC_FRAME_PATH_CHALLENGE: {
QUIC_PATH_CHALLENGE_EX Frame;
if (!QuicPathChallengeFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] PATH_CHALLENGE [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] PATH_CHALLENGE [%llu]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, QuicByteSwapUint64(*(uint64_t*)Frame.Data));
break;
@ -1478,13 +1478,13 @@ QuicFrameLog(
case QUIC_FRAME_PATH_RESPONSE: {
QUIC_PATH_RESPONSE_EX Frame;
if (!QuicPathChallengeFrameDecode(PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] PATH_RESPONSE [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] PATH_RESPONSE [%llu]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, QuicByteSwapUint64(*(uint64_t*)Frame.Data));
break;
@ -1494,18 +1494,18 @@ QuicFrameLog(
case QUIC_FRAME_CONNECTION_CLOSE_1: {
QUIC_CONNECTION_CLOSE_EX Frame;
if (!QuicConnCloseFrameDecode(FrameType, PacketLength, Packet, Offset, &Frame)) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] CONN_CLOSE [Invalid]",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber);
return FALSE;
}
if (Frame.ApplicationClosed) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] CONN_CLOSE (App) ErrorCode:0x%llX",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.ErrorCode);
} else {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] CONN_CLOSE ErrorCode:0x%llX FrameType:%llu",
PtkConnPre(Connection), PktRxPre(Rx), PacketNumber, Frame.ErrorCode, Frame.FrameType);
}

Просмотреть файл

@ -161,13 +161,6 @@ QuicVarPktNumDecodeLength(
uint8_t FirstByte
);
uint64_t
QuicPacketNumberDecompressV2(
_In_ uint64_t ExpectedPacketNumber,
_In_ uint64_t CompressedPacketNumber,
_In_ uint8_t CompressedPacketNumberBytes
);
BOOLEAN
QuicIsVersionReserved(
_In_ uint32_t Version // Either Byte Order
@ -432,13 +425,6 @@ QuicConnLogOutFlowStats(
_In_ const QUIC_CONNECTION* const Connection
);
uint64_t
QuicPacketNumberDecompress(
_In_ uint64_t ExpectedPacketNumber,
_In_ uint64_t CompressedPacketNumber,
_In_ uint8_t CompressedPacketNumberBytes
);
void
QuicOperLog(
_In_ const void* Connection,
@ -473,7 +459,7 @@ QuicPktNumDecode(
);
uint64_t
QuicPacketNumberDecompress(
QuicPktNumDecompress(
_In_ uint64_t ExpectedPacketNumber,
_In_ uint64_t CompressedPacketNumber,
_In_ uint8_t CompressedPacketNumberBytes

Просмотреть файл

@ -88,7 +88,7 @@ MsQuicLibraryReadSettings(
QuicSettingsLoad(&MsQuicLib.Settings, MsQuicLib.Storage);
}
LogInfo("[ lib] Settings %p Updated", &MsQuicLib.Settings);
QuicTraceLogInfo("[ lib] Settings %p Updated", &MsQuicLib.Settings);
QuicSettingsDump(&MsQuicLib.Settings);
BOOLEAN UpdateRegistrations = (Context != NULL);
@ -132,7 +132,7 @@ MsQuicLibraryInitialize(
(void*)TRUE, // Non-null indicates registrations should be updated
&MsQuicLib.Storage);
if (QUIC_FAILED(Status)) {
LogWarning("[ lib] Failed to open global settings, 0x%x", Status);
QuicTraceLogWarning("[ lib] Failed to open global settings, 0x%x", Status);
Status = QUIC_STATUS_SUCCESS; // Non-fatal, as the process may not have access
}
@ -146,7 +146,7 @@ MsQuicLibraryInitialize(
RawKey,
&MsQuicLib.StatelessRetryKey);
if (QUIC_FAILED(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Create stateless retry key");
QuicTraceEvent(LibraryErrorStatus, Status, "Create stateless retry key");
goto Error;
}
@ -163,7 +163,7 @@ MsQuicLibraryInitialize(
MsQuicLib.PerProc =
QUIC_ALLOC_NONPAGED(MsQuicLib.PartitionCount * sizeof(QUIC_LIBRARY_PP));
if (MsQuicLib.PerProc == NULL) {
EventWriteQuicAllocFailure("connection pools",
QuicTraceEvent(AllocFailure, "connection pools",
MsQuicLib.PartitionCount * sizeof(QUIC_LIBRARY_PP));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
@ -183,11 +183,11 @@ MsQuicLibraryInitialize(
QuicBindingUnreachable,
&MsQuicLib.Datapath);
if (QUIC_FAILED(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "QuicDataPathInitialize");
QuicTraceEvent(LibraryErrorStatus, Status, "QuicDataPathInitialize");
goto Error;
}
EventWriteQuicLibraryInitialized(
QuicTraceEvent(LibraryInitialized,
MsQuicLib.PartitionCount,
QuicDataPathGetSupportedFeatures(MsQuicLib.Datapath));
@ -196,9 +196,9 @@ MsQuicLibraryInitialize(
MsQuicLib.IsVerifying = QuicVerifierEnabled(Flags);
if (MsQuicLib.IsVerifying) {
#ifdef QuicVerifierEnabledByAddr
LogInfo("[ lib] Verifing enabled, per-registration!");
QuicTraceLogInfo("[ lib] Verifing enabled, per-registration!");
#else
LogInfo("[ lib] Verifing enabled for all!");
QuicTraceLogInfo("[ lib] Verifing enabled for all!");
#endif
}
#endif
@ -282,7 +282,7 @@ MsQuicLibraryUninitialize(
QuicDataPathUninitialize(MsQuicLib.Datapath);
MsQuicLib.Datapath = NULL;
EventWriteQuicLibraryUninitialized();
QuicTraceEvent(LibraryUninitialized);
QuicPlatformUninitialize();
}
@ -318,7 +318,7 @@ MsQuicAddRef(
}
}
EventWriteQuicLibraryAddRef();
QuicTraceEvent(LibraryAddRef);
Error:
@ -341,7 +341,7 @@ MsQuicRelease(
//
QUIC_FRE_ASSERT(MsQuicLib.RefCount > 0);
EventWriteQuicLibraryRelease();
QuicTraceEvent(LibraryRelease);
if (--MsQuicLib.RefCount == 0) {
MsQuicLibraryUninitialize();
@ -698,12 +698,12 @@ MsQuicOpen(
QUIC_STATUS Status;
if (QuicApi == NULL) {
LogVerbose("[ api] MsQuicOpen, NULL");
QuicTraceLogVerbose("[ api] MsQuicOpen, NULL");
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Exit;
}
LogVerbose("[ api] MsQuicOpen, %u", ApiVersion);
QuicTraceLogVerbose("[ api] MsQuicOpen, %u", ApiVersion);
if ((ApiVersion == 0 || ApiVersion > QUIC_API_VERSION_1) &&
ApiVersion != QUIC_API_VERSION_PRIVATE) {
@ -826,7 +826,7 @@ Error:
Exit:
LogVerbose("[ api] MsQuicOpen, status=0x%x", Status);
QuicTraceLogVerbose("[ api] MsQuicOpen, status=0x%x", Status);
return Status;
}
@ -840,7 +840,7 @@ MsQuicClose(
)
{
if (QuicApi != NULL) {
LogVerbose("[ api] MsQuicClose");
QuicTraceLogVerbose("[ api] MsQuicClose");
QUIC_FREE(QuicApi);
MsQuicRelease();
}
@ -1090,7 +1090,7 @@ QuicLibraryOnListenerRegistered(
//
// Make sure the handshake worker threads are initialized.
//
EventWriteQuicLibraryWorkerPoolInit();
QuicTraceEvent(LibraryWorkerPoolInit);
if (QUIC_FAILED(
QuicWorkerPoolInitialize(
NULL,
@ -1131,7 +1131,7 @@ QuicTraceRundown(
QuicLockAcquire(&MsQuicLib.Lock);
if (MsQuicLib.RefCount > 0) {
EventWriteQuicLibraryRundown(
QuicTraceEvent(LibraryRundown,
MsQuicLib.PartitionCount,
QuicDataPathGetSupportedFeatures(MsQuicLib.Datapath));

Просмотреть файл

@ -30,7 +30,7 @@ MsQuicListenerOpen(
QUIC_SESSION* Session;
QUIC_LISTENER* Listener = NULL;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_LISTENER_OPEN,
SessionHandle);
@ -46,7 +46,7 @@ MsQuicListenerOpen(
Listener = QUIC_ALLOC_NONPAGED(sizeof(QUIC_LISTENER));
if (Listener == NULL) {
EventWriteQuicAllocFailure("listener", sizeof(QUIC_LISTENER));
QuicTraceEvent(AllocFailure, "listener", sizeof(QUIC_LISTENER));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -61,7 +61,7 @@ MsQuicListenerOpen(
#pragma prefast(suppress: __WARNING_6031, "Will always succeed.")
QuicRundownAcquire(&Session->Rundown);
EventWriteQuicListenerCreated(Listener, Listener->Session);
QuicTraceEvent(ListenerCreated, Listener, Listener->Session);
*NewListener = (HQUIC)Listener;
Status = QUIC_STATUS_SUCCESS;
@ -74,7 +74,7 @@ Error:
}
}
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -97,7 +97,7 @@ MsQuicListenerClose(
return;
}
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_LISTENER_CLOSE,
Handle);
@ -113,10 +113,10 @@ MsQuicListenerClose(
QuicRundownUninitialize(&Listener->Rundown);
QUIC_FREE(Listener);
EventWriteQuicListenerDestroyed(Listener);
QuicTraceEvent(ListenerDestroyed, Listener);
QuicRundownRelease(&Session->Rundown);
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -132,7 +132,7 @@ MsQuicListenerStart(
BOOLEAN PortUnspecified;
QUIC_ADDR BindingLocalAddress = {0};
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_LISTENER_START,
Handle);
@ -186,14 +186,14 @@ MsQuicListenerStart(
NULL,
&Listener->Binding);
if (QUIC_FAILED(Status)) {
EventWriteQuicListenerErrorStatus(Listener, Status, "Get binding");
QuicTraceEvent(ListenerErrorStatus, Listener, Status, "Get binding");
goto Error;
}
QuicRundownReInitialize(&Listener->Rundown);
if (!QuicBindingRegisterListener(Listener->Binding, Listener)) {
EventWriteQuicListenerError(Listener, "Register with binding");
QuicTraceEvent(ListenerError, Listener, "Register with binding");
QuicRundownRelease(&Listener->Rundown);
Status = QUIC_STATUS_INVALID_STATE;
goto Error;
@ -208,7 +208,7 @@ MsQuicListenerStart(
QuicAddrGetPort(&BindingLocalAddress));
}
EventWriteQuicListenerStarted(
QuicTraceEvent(ListenerStarted,
Listener,
Listener->Binding,
LOG_ADDR_LEN(Listener->LocalAddress),
@ -225,7 +225,7 @@ Error:
Exit:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -237,7 +237,7 @@ MsQuicListenerStop(
_In_ _Pre_defensive_ HQUIC Handle
)
{
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_LISTENER_STOP,
Handle);
@ -250,11 +250,11 @@ MsQuicListenerStop(
Listener->Binding = NULL;
QuicRundownReleaseAndWait(&Listener->Rundown);
EventWriteQuicListenerStopped(Listener);
QuicTraceEvent(ListenerStopped, Listener);
}
}
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(DISPATCH_LEVEL)
@ -263,9 +263,9 @@ QuicListenerTraceRundown(
_In_ QUIC_LISTENER* Listener
)
{
EventWriteQuicListenerRundown(Listener, Listener->Session);
QuicTraceEvent(ListenerRundown, Listener, Listener->Session);
if (Listener->Binding != NULL) {
EventWriteQuicListenerStarted(
QuicTraceEvent(ListenerStarted,
Listener,
Listener->Binding,
LOG_ADDR_LEN(Listener->LocalAddress),
@ -289,7 +289,7 @@ QuicListenerIndicateEvent(
Event);
uint64_t EndTime = QuicTimeUs64();
if (EndTime - StartTime > QUIC_MAX_CALLBACK_TIME_WARNING) {
LogWarning("[list][%p] App took excessive time (%llu us) in callback.",
QuicTraceLogWarning("[list][%p] App took excessive time (%llu us) in callback.",
Listener, (EndTime - StartTime));
QUIC_TEL_ASSERTMSG_ARGS(
EndTime - StartTime < QUIC_MAX_CALLBACK_TIME_ERROR,
@ -328,24 +328,24 @@ QuicListenerClaimConnection(
QuicSessionAttachSilo(Listener->Session);
LogVerbose("[list][%p] Indicating NEW_CONNECTION", Listener);
QuicTraceLogVerbose("[list][%p] Indicating NEW_CONNECTION", Listener);
QUIC_STATUS Status = QuicListenerIndicateEvent(Listener, &Event);
QuicSessionDetachSilo();
if (Status == QUIC_STATUS_PENDING) {
LogVerbose("[list][%p] App indicate pending NEW_CONNECTION", Listener);
QuicTraceLogVerbose("[list][%p] App indicate pending NEW_CONNECTION", Listener);
QUIC_DBG_ASSERT(Event.NEW_CONNECTION.SecurityConfig == NULL);
*SecConfig = NULL;
} else if (QUIC_FAILED(Status)) {
EventWriteQuicListenerErrorStatus(Listener, Status, "NEW_CONNECTION callback");
QuicTraceEvent(ListenerErrorStatus, Listener, Status, "NEW_CONNECTION callback");
goto Exit;
} else if (Event.NEW_CONNECTION.SecurityConfig == NULL) {
EventWriteQuicListenerError(Listener, "NEW_CONNECTION callback didn't set SecConfig");
QuicTraceEvent(ListenerError, Listener, "NEW_CONNECTION callback didn't set SecConfig");
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Exit;
} else {
LogVerbose("[list][%p] App accepted NEW_CONNECTION", Listener);
QuicTraceLogVerbose("[list][%p] App accepted NEW_CONNECTION", Listener);
*SecConfig = Event.NEW_CONNECTION.SecurityConfig;
}
@ -416,14 +416,14 @@ QuicListenerAcceptConnection(
Listener->TotalRejectedConnections++;
goto Error;
} else if (SecConfig == NULL) {
LogVerbose("[conn][%p] No security config was provided by the app.", Connection);
QuicTraceLogConnVerbose(NoSecurityConfigAvailable, Connection, "No security config was provided by the app.");
Listener->TotalRejectedConnections++;
goto Error;
}
}
Connection->Stats.Timing.Start = QuicTimeUs64();
EventWriteQuicConnHandshakeStart(Connection);
QuicTraceEvent(ConnHandshakeStart, Connection);
if (Status != QUIC_STATUS_PENDING) {
Status = QuicConnHandshakeConfigure(Connection, SecConfig);

Просмотреть файл

@ -357,9 +357,9 @@ QuicLookupFindConnectionInternal(
#if QUIC_DEBUG_HASHTABLE_LOOKUP
if (Connection != NULL) {
LogVerbose("[bind][%p] Lookup Hash=%u found %p", Lookup, Hash, Connection);
QuicTraceLogVerbose("[bind][%p] Lookup Hash=%u found %p", Lookup, Hash, Connection);
} else {
LogVerbose("[bind][%p] Lookup Hash=%u not found", Lookup, Hash);
QuicTraceLogVerbose("[bind][%p] Lookup Hash=%u not found", Lookup, Hash);
}
#endif
@ -418,7 +418,7 @@ QuicLookupInsertSourceConnectionID(
}
#if QUIC_DEBUG_HASHTABLE_LOOKUP
LogVerbose("[bind][%p] Insert Conn=%p Hash=%u", Lookup, Connection, Hash);
QuicTraceLogVerbose("[bind][%p] Insert Conn=%p Hash=%u", Lookup, Connection, Hash);
#endif
return TRUE;
@ -439,7 +439,7 @@ QuicLookupRemoveSourceConnectionIDInt(
Lookup->CidCount--;
#if QUIC_DEBUG_HASHTABLE_LOOKUP
LogVerbose("[bind][%p] Remove Conn=%p", Lookup, SourceCID->Connection);
QuicTraceLogVerbose("[bind][%p] Remove Conn=%p", Lookup, SourceCID->Connection);
#endif
if (Lookup->PartitionCount == 0) {

Просмотреть файл

@ -85,7 +85,7 @@ QuicLossDetectionUninitialize(
LossDetection->SentPackets = LossDetection->SentPackets->Next;
if (Packet->Flags.IsRetransmittable) {
LogVerbose("[%c][TX][%llu] Thrown away on shutdown",
QuicTraceLogVerbose("[%c][TX][%llu] Thrown away on shutdown",
PtkConnPre(Connection), Packet->PacketNumber);
}
@ -96,7 +96,7 @@ QuicLossDetectionUninitialize(
QUIC_SENT_PACKET_METADATA* Packet = LossDetection->LostPackets;
LossDetection->LostPackets = LossDetection->LostPackets->Next;
LogVerbose("[%c][TX][%llu] Thrown away on shutdown (lost packet)",
QuicTraceLogVerbose("[%c][TX][%llu] Thrown away on shutdown (lost packet)",
PtkConnPre(Connection), Packet->PacketNumber);
QuicSentPacketPoolReturnPacketMetadata(&Connection->Worker->SentPacketPool, Packet);
@ -197,7 +197,7 @@ QuicLossDetectionUpdateTimer(
//
// No retransmission timer runs after the connection has been shut down.
//
EventWriteQuicConnLossDetectionTimerCancel(Connection);
QuicTraceEvent(ConnLossDetectionTimerCancel, Connection);
QuicConnTimerCancel(Connection, QUIC_CONN_TIMER_LOSS_DETECTION);
return;
}
@ -214,7 +214,7 @@ QuicLossDetectionUpdateTimer(
// doing amplification protection, which means more data might need to
// be sent to unblock it.
//
EventWriteQuicConnLossDetectionTimerCancel(Connection);
QuicTraceEvent(ConnLossDetectionTimerCancel, Connection);
QuicConnTimerCancel(Connection, QUIC_CONN_TIMER_LOSS_DETECTION);
return;
}
@ -226,7 +226,7 @@ QuicLossDetectionUpdateTimer(
// Sending is restricted for amplification protection.
// Don't run the timer, because nothing can be sent when it fires.
//
EventWriteQuicConnLossDetectionTimerCancel(Connection);
QuicTraceEvent(ConnLossDetectionTimerCancel, Connection);
QuicConnTimerCancel(Connection, QUIC_CONN_TIMER_LOSS_DETECTION);
return;
}
@ -306,7 +306,7 @@ QuicLossDetectionUpdateTimer(
Delay = US_TO_MS(Delay) + 1;
}
EventWriteQuicConnLossDetectionTimerSet(
QuicTraceEvent(ConnLossDetectionTimerSet,
Connection, TimeoutType, Delay, LossDetection->ProbeCount);
UNREFERENCED_PARAMETER(TimeoutType);
QuicConnTimerSet(Connection, QUIC_CONN_TIMER_LOSS_DETECTION, Delay);
@ -394,7 +394,7 @@ QuicLossDetectionOnPacketAcknowledged(
if (!Connection->State.HandshakeConfirmed &&
Packet->Flags.KeyType == QUIC_PACKET_KEY_1_RTT) {
LogInfo("[conn][%p] Handshake confirmed.", Connection);
QuicTraceLogConnInfo(HandshakeConfirmed, Connection, "Handshake confirmed.");
Connection->State.HandshakeConfirmed = TRUE;
QuicCryptoDiscardKeys(&Connection->Crypto, QUIC_PACKET_KEY_HANDSHAKE);
}
@ -404,7 +404,7 @@ QuicLossDetectionOnPacketAcknowledged(
PacketSpace->AwaitingKeyPhaseConfirmation &&
Packet->Flags.KeyPhase == PacketSpace->CurrentKeyPhase &&
Packet->PacketNumber >= PacketSpace->WriteKeyPhaseStartPacketNumber) {
LogVerbose("[conn][%p] Key change confirmed by peer.", Connection);
QuicTraceLogConnVerbose(KeyChangeConfirmed, Connection, "Key change confirmed by peer.");
PacketSpace->AwaitingKeyPhaseConfirmation = FALSE;
}
@ -666,7 +666,7 @@ QuicLossDetectionDetectAndHandleLostPackets(
while ((Packet = LossDetection->LostPackets) != NULL &&
Packet->PacketNumber < LossDetection->LargestAck &&
QuicTimeDiff32(Packet->SentTime, TimeNow) > TwoPto) {
LogVerbose("[%c][TX][%llu] Forgetting",
QuicTraceLogVerbose("[%c][TX][%llu] Forgetting",
PtkConnPre(Connection), Packet->PacketNumber);
LossDetection->LostPackets = Packet->Next;
QuicSentPacketPoolReturnPacketMetadata(&Connection->Worker->SentPacketPool, Packet);
@ -705,12 +705,12 @@ QuicLossDetectionDetectAndHandleLostPackets(
continue;
} else if (Packet->PacketNumber + QUIC_PACKET_REORDER_THRESHOLD < LossDetection->LargestAck) {
if (!NonretransmittableHandshakePacket) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][TX][%llu] Lost: FACK %llu packets",
PtkConnPre(Connection),
Packet->PacketNumber,
LossDetection->LargestAck - Packet->PacketNumber);
EventWriteQuicConnPacketLost(
QuicTraceEvent(ConnPacketLost,
Connection,
Packet->PacketNumber,
QuicPacketTraceType(Packet),
@ -719,12 +719,12 @@ QuicLossDetectionDetectAndHandleLostPackets(
} else if (Packet->PacketNumber < LossDetection->LargestAck &&
QuicTimeAtOrBefore32(Packet->SentTime + TimeReorderThreshold, TimeNow)) {
if (!NonretransmittableHandshakePacket) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][TX][%llu] Lost: RACK %lu ms",
PtkConnPre(Connection),
Packet->PacketNumber,
QuicTimeDiff32(Packet->SentTime, TimeNow));
EventWriteQuicConnPacketLost(
QuicTraceEvent(ConnPacketLost,
Connection,
Packet->PacketNumber,
QuicPacketTraceType(Packet),
@ -816,10 +816,10 @@ QuicLossDetectionDiscardPackets(
}
}
LogVerbose("[%c][TX][%llu] ACKed (implicit)",
QuicTraceLogVerbose("[%c][TX][%llu] ACKed (implicit)",
PtkConnPre(Connection),
Packet->PacketNumber);
EventWriteQuicConnPacketACKed(
QuicTraceEvent(ConnPacketACKed,
Connection,
Packet->PacketNumber,
QuicPacketTraceType(Packet));
@ -852,10 +852,10 @@ QuicLossDetectionDiscardPackets(
}
}
LogVerbose("[%c][TX][%llu] ACKed (implicit)",
QuicTraceLogVerbose("[%c][TX][%llu] ACKed (implicit)",
PtkConnPre(Connection),
Packet->PacketNumber);
EventWriteQuicConnPacketACKed(
QuicTraceEvent(ConnPacketACKed,
Connection,
Packet->PacketNumber,
QuicPacketTraceType(Packet));
@ -925,7 +925,7 @@ QuicLossDetectionOnZeroRttRejected(
}
}
LogVerbose("[%c][TX][%llu] Rejected",
QuicTraceLogVerbose("[%c][TX][%llu] Rejected",
PtkConnPre(Connection),
Packet->PacketNumber);
@ -1000,7 +1000,7 @@ QuicLossDetectionProcessAckBlocks(
}
QUIC_SENT_PACKET_METADATA** End = LostPacketsStart;
while (*End && (*End)->PacketNumber <= QuicRangeGetHigh(AckBlock)) {
LogVerbose("[%c][TX][%llu] Spurious loss detected",
QuicTraceLogVerbose("[%c][TX][%llu] Spurious loss detected",
PtkConnPre(Connection),
(*End)->PacketNumber);
Connection->Stats.Send.SpuriousLostPackets++;
@ -1084,17 +1084,17 @@ QuicLossDetectionProcessAckBlocks(
//
// The packet was not acknowledged with the same encryption level.
//
EventWriteQuicConnError(Connection, "Incorrect ACK encryption level");
QuicTraceEvent(ConnError, Connection, "Incorrect ACK encryption level");
*InvalidAckBlock = TRUE;
return;
}
uint32_t PacketRtt = QuicTimeDiff32(Packet->SentTime, TimeNow);
LogVerbose("[%c][TX][%llu] ACKed (%u.%u ms)",
QuicTraceLogVerbose("[%c][TX][%llu] ACKed (%u.%u ms)",
PtkConnPre(Connection),
Packet->PacketNumber,
PacketRtt / 1000, PacketRtt % 1000);
EventWriteQuicConnPacketACKed(
QuicTraceEvent(ConnPacketACKed,
Connection,
Packet->PacketNumber,
QuicPacketTraceType(Packet));
@ -1234,7 +1234,7 @@ QuicLossDetectionScheduleProbe(
QUIC_CONNECTION* Connection = QuicLossDetectionGetConnection(LossDetection);
LossDetection->ProbeCount++;
LogInfo("[conn][%p] probe round %lu", Connection, LossDetection->ProbeCount);
QuicTraceLogConnInfo(ScheduleProbe, Connection, "probe round %lu", LossDetection->ProbeCount);
//
// Below, we will schedule a fixed number packets to be retransmitted. What
@ -1280,11 +1280,11 @@ QuicLossDetectionScheduleProbe(
QUIC_SENT_PACKET_METADATA* Packet = LossDetection->SentPackets;
while (Packet != NULL) {
if (Packet->Flags.IsRetransmittable) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][TX][%llu] Probe Retransmit",
PtkConnPre(Connection),
Packet->PacketNumber);
EventWriteQuicConnPacketLost(
QuicTraceEvent(ConnPacketLost,
Connection,
Packet->PacketNumber,
QuicPacketTraceType(Packet),

Просмотреть файл

@ -224,13 +224,13 @@ QuicOperLog(
{
switch (Oper->Type) {
case QUIC_OPER_TYPE_API_CALL:
EventWriteQuicConnExecApiOper(Connection, Oper->API_CALL.Context->Type);
QuicTraceEvent(ConnExecApiOper, Connection, Oper->API_CALL.Context->Type);
break;
case QUIC_OPER_TYPE_TIMER_EXPIRED:
EventWriteQuicConnExecTimerOper(Connection, Oper->TIMER_EXPIRED.Type);
QuicTraceEvent(ConnExecTimerOper, Connection, Oper->TIMER_EXPIRED.Type);
break;
default:
EventWriteQuicConnExecOper(Connection, Oper->Type);
QuicTraceEvent(ConnExecOper, Connection, Oper->Type);
break;
}
}

Просмотреть файл

@ -401,7 +401,7 @@ QuicPacketLogHeader(
switch (Invariant->LONG_HDR.Version) {
case QUIC_VERSION_VER_NEG: {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][-] VerNeg DestCID:%s SrcCID:%s (Payload %lu bytes)",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -410,7 +410,7 @@ QuicPacketLogHeader(
PacketLength - Offset);
while (Offset < PacketLength) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][-] Ver:0x%x",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -444,7 +444,7 @@ QuicPacketLogHeader(
const uint8_t* OrigDestCID = SourceCID + sizeof(uint8_t) + SourceCIDLen;
Offset += sizeof(uint8_t) + OrigDestCIDLen;
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][-] LH Ver:0x%x DestCID:%s SrcCID:%s Type:R OrigDestCID:%s (Token %hu bytes)",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -468,7 +468,7 @@ QuicPacketLogHeader(
}
if (LongHdr->Type == QUIC_INITIAL) {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] LH Ver:0x%x DestCID:%s SrcCID:%s Type:%s (Token %hu bytes) (Payload %hu bytes) (PktNum %hu bytes)",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -481,7 +481,7 @@ QuicPacketLogHeader(
(uint16_t)Length,
LongHdr->PnLength + 1);
} else {
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] LH Ver:0x%x DestCID:%s SrcCID:%s Type:%s (Payload %hu bytes) (PktNum %hu bytes)",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -497,7 +497,7 @@ QuicPacketLogHeader(
}
default:
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] LH Ver:[UNSUPPORTED,0x%x] DestCID:%s SrcCID:%s",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -521,7 +521,7 @@ QuicPacketLogHeader(
Offset = sizeof(QUIC_SHORT_HEADER_V1) + DestCIDLen;
LogVerbose(
QuicTraceLogVerbose(
"[%c][%cX][%llu] SH DestCID:%s KP:%hu SB:%hu (Payload %hu bytes)",
PtkConnPre(Connection),
PktRxPre(Rx),
@ -553,7 +553,7 @@ QuicPacketLogDrop(
if (Packet->AssignedToConnection) {
InterlockedIncrement64((int64_t*) &((QUIC_CONNECTION*)Owner)->Stats.Recv.DroppedPackets);
EventWriteQuicConnDropPacket(
QuicTraceEvent(ConnDropPacket,
Owner,
Packet->PacketNumberSet ? UINT64_MAX : Packet->PacketNumber,
LOG_ADDR_LEN(Datagram->Tuple->LocalAddress),
@ -563,7 +563,7 @@ QuicPacketLogDrop(
Reason);
} else {
InterlockedIncrement64((int64_t*) &((QUIC_BINDING*)Owner)->Stats.Recv.DroppedPackets);
EventWriteQuicBindingDropPacket(
QuicTraceEvent(BindingDropPacket,
Owner,
Packet->PacketNumberSet ? UINT64_MAX : Packet->PacketNumber,
LOG_ADDR_LEN(Datagram->Tuple->LocalAddress),
@ -588,7 +588,7 @@ QuicPacketLogDropWithValue(
if (Packet->AssignedToConnection) {
InterlockedIncrement64((int64_t*) & ((QUIC_CONNECTION*)Owner)->Stats.Recv.DroppedPackets);
EventWriteQuicConnDropPacketEx(
QuicTraceEvent(ConnDropPacketEx,
Owner,
Packet->PacketNumberSet ? UINT64_MAX : Packet->PacketNumber,
Value,
@ -599,7 +599,7 @@ QuicPacketLogDropWithValue(
Reason);
} else {
InterlockedIncrement64((int64_t*) &((QUIC_BINDING*)Owner)->Stats.Recv.DroppedPackets);
EventWriteQuicBindingDropPacketEx(
QuicTraceEvent(BindingDropPacketEx,
Owner,
Packet->PacketNumberSet ? UINT64_MAX : Packet->PacketNumber,
Value,

Просмотреть файл

@ -305,6 +305,59 @@ QuicPktNumDecode(
}
}
//
// Decompress a packet number based on the expected next packet number.
// A compressed packet number is just the lowest N bytes of the full packet
// number. To decompress the packet number, we do a bit of math to find the
// closest packet number to the next expected packet number, that has the
// given low bytes.
//
inline
_IRQL_requires_max_(DISPATCH_LEVEL)
uint64_t
QuicPktNumDecompress(
_In_ uint64_t ExpectedPacketNumber,
_In_ uint64_t CompressedPacketNumber,
_In_ uint8_t CompressedPacketNumberBytes
)
{
QUIC_DBG_ASSERT(CompressedPacketNumberBytes < 8);
const uint64_t Mask = 0xFFFFFFFFFFFFFFFF << (8 * CompressedPacketNumberBytes);
const uint64_t PacketNumberInc = (~Mask) + 1;
uint64_t PacketNumber = (Mask & ExpectedPacketNumber) | CompressedPacketNumber;
if (PacketNumber < ExpectedPacketNumber) {
//
// If our intermediate packet number is less than the expected packet
// number, then we need see if we would be closer to 'next' high bit
// packet number.
//
uint64_t High = ExpectedPacketNumber - PacketNumber;
uint64_t Low = PacketNumberInc - High;
if (Low < High) {
PacketNumber += PacketNumberInc;
}
} else {
//
// If our intermediate packet number is greater than or equal to the
// expected packet number, then we need see if we would be closer to
// 'previous' high bit packet number.
//
uint64_t Low = PacketNumber - ExpectedPacketNumber;
uint64_t High = PacketNumberInc - Low;
if (High <= Low && PacketNumber >= PacketNumberInc) {
PacketNumber -= PacketNumberInc;
}
}
return PacketNumber;
}
//
// Encodes the long header fields.
//

Просмотреть файл

@ -54,7 +54,7 @@ QuicPacketBuilderInitialize(
QUIC_ENCRYPTION_OVERHEAD : 0;
if (Connection->SourceCIDs.Next == NULL) {
LogWarning("[conn][%p] No src CID to send with.", Connection);
QuicTraceLogConnWarning(NoSrcCidAvailable, Connection, "No src CID to send with.");
return FALSE;
}
@ -173,7 +173,7 @@ QuicPacketBuilderPrepare(
QuicAddrGetFamily(&Builder->Path->RemoteAddress),
DatagramSize));
if (Builder->SendContext == NULL) {
EventWriteQuicAllocFailure("packet send context", 0);
QuicTraceEvent(AllocFailure, "packet send context", 0);
goto Error;
}
}
@ -192,7 +192,7 @@ QuicPacketBuilderPrepare(
Builder->SendContext,
NewDatagramLength);
if (Builder->Datagram == NULL) {
EventWriteQuicAllocFailure("packet datagram", NewDatagramLength);
QuicTraceEvent(AllocFailure, "packet datagram", NewDatagramLength);
goto Error;
}
@ -231,7 +231,7 @@ QuicPacketBuilderPrepare(
Builder->MinimumDatagramLength = NewDatagramLength;
}
LogVerbose("[pktb][%p] New UDP datagram. Space: %u",
QuicTraceLogVerbose("[pktb][%p] New UDP datagram. Space: %u",
Connection, Builder->Datagram->Length);
}
@ -310,7 +310,7 @@ QuicPacketBuilderPrepare(
Builder->DatagramLength += Builder->HeaderLength;
LogVerbose("[pktb][%p] New QUIC packet. Space: %hu. Type: %hx",
QuicTraceLogVerbose("[pktb][%p] New QUIC packet. Space: %hu. Type: %hx",
Connection, BufferSpaceAvailable, NewPacketType);
}
@ -423,8 +423,8 @@ QuicPacketBuilderPrepareForControlFrames(
SendFlags,
&PacketType,
&PacketKey)) {
LogWarning("[conn][%p] Failed to get packet type for control frames, 0x%x",
Builder->Connection, SendFlags);
QuicTraceLogConnWarning(GetPacketTypeFailure, Builder->Connection, "Failed to get packet type for control frames, 0x%x",
SendFlags);
QUIC_DBG_ASSERT(FALSE); // This shouldn't have been called then!
return FALSE;
}
@ -627,7 +627,7 @@ QuicPacketBuilderFinalize(
QuicFuzzInjectHook(Builder);
#endif
if (LogVerboseEnabled()) {
if (QuicTraceLogVerboseEnabled()) {
QuicPacketLogHeader(
Connection,
FALSE,
@ -643,7 +643,6 @@ QuicPacketBuilderFinalize(
Builder->HeaderLength + PayloadLength,
Header,
Builder->HeaderLength);
QuicLogBuffer(Header, Builder->HeaderLength + PayloadLength);
}
if (Connection->State.EncryptionEnabled) {
@ -740,7 +739,7 @@ QuicPacketBuilderFinalize(
Status = QuicCryptoGenerateNewKeys(Connection);
if (QUIC_FAILED(Status)) {
EventWriteQuicConnErrorStatus(
QuicTraceEvent(ConnErrorStatus,
Connection,
Status,
"Send-triggered key update");
@ -766,7 +765,7 @@ QuicPacketBuilderFinalize(
Builder->Metadata->PacketLength =
Builder->HeaderLength + PayloadLength;
EventWriteQuicConnPacketSent(
QuicTraceEvent(ConnPacketSent,
Connection,
Builder->Metadata->PacketNumber,
QuicPacketTraceType(Builder->Metadata),
@ -826,7 +825,7 @@ QuicPacketBuilderSendBatch(
_Inout_ QUIC_PACKET_BUILDER* Builder
)
{
LogVerbose("[pktb][%p] Sending batch. %hu datagrams",
QuicTraceLogVerbose("[pktb][%p] Sending batch. %hu datagrams",
Builder->Connection, (uint16_t)Builder->TotalCountDatagrams);
if (QuicAddrIsBoundExplicitly(&Builder->Path->LocalAddress)) {

Просмотреть файл

@ -29,7 +29,7 @@ QuicPacketSpaceInitialize(
Packets = QUIC_ALLOC_NONPAGED(sizeof(QUIC_PACKET_SPACE));
if (Packets == NULL) {
EventWriteQuicAllocFailure("packet space", sizeof(QUIC_PACKET_SPACE));
QuicTraceEvent(AllocFailure, "packet space", sizeof(QUIC_PACKET_SPACE));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}

Просмотреть файл

@ -31,7 +31,7 @@ QuicPathInitialize(
Path->MinRtt = UINT32_MAX;
Path->Mtu = QUIC_DEFAULT_PATH_MTU;
LogInfo("[conn][%p] Path[%u] Initialized", Connection, Path->ID);
QuicTraceLogConnInfo(PathInitialized, Connection, "Path[%u] Initialized", Path->ID);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -89,7 +89,7 @@ QuicPathSetValid(
"Path Response"
};
LogInfo("[conn][%p] Path[%u] Validated (%s)", Connection, Path->ID, ReasonStrings[Reason]);
QuicTraceLogConnInfo(PathValidated, Connection, "Path[%u] Validated (%s)", Path->ID, ReasonStrings[Reason]);
Path->IsPeerValidated = TRUE;
QuicPathSetAllowance(Connection, Path, UINT32_MAX);
@ -187,7 +187,7 @@ QuicPathSetActive(
QuicAddrGetFamily(&Path->RemoteAddress) == QuicAddrGetFamily(&Connection->Paths[0].RemoteAddress) &&
QuicAddrCompareIp(&Path->RemoteAddress, &Connection->Paths[0].RemoteAddress);
LogInfo("[conn][%p] Path[%u] Set active (rebind=%hu)", Connection, Path->ID, UdpPortChangeOnly);
QuicTraceLogConnInfo(PathActive, Connection, "Path[%u] Set active (rebind=%hu)", Path->ID, UdpPortChangeOnly);
QUIC_PATH PrevActivePath = Connection->Paths[0];
@ -216,7 +216,7 @@ QuicConnRemoveInvalidPaths(
if (Connection->Paths[i].GotValidPacket) {
continue;
}
LogInfo("[conn][%p] Path[%u] Discarded (invalid)", Connection, Connection->Paths[i].ID);
QuicTraceLogConnInfo(PathDiscarded, Connection, "Path[%u] Discarded (invalid)", Connection->Paths[i].ID);
if (i + 1 < Connection->PathsCount) {
QuicMoveMemory(
&Connection->Paths[i],

Просмотреть файл

@ -65,7 +65,6 @@ extern "C" {
#include "connection.h"
#include "packet_builder.h"
#include "listener.h"
#include "utils.h"
#if defined(__cplusplus)
}

Просмотреть файл

@ -31,7 +31,7 @@ QuicRangeInitialize(
QUIC_FRE_ASSERT(sizeof(QUIC_SUBRANGE) * INITIAL_SUBRANGE_COUNT < MaxAllocSize);
Range->SubRanges = QUIC_ALLOC_NONPAGED(sizeof(QUIC_SUBRANGE) * INITIAL_SUBRANGE_COUNT);
if (Range->SubRanges == NULL) {
EventWriteQuicAllocFailure("range", sizeof(QUIC_SUBRANGE) * INITIAL_SUBRANGE_COUNT);
QuicTraceEvent(AllocFailure, "range", sizeof(QUIC_SUBRANGE) * INITIAL_SUBRANGE_COUNT);
}
return (Range->SubRanges == NULL) ? QUIC_STATUS_OUT_OF_MEMORY : QUIC_STATUS_SUCCESS;
}
@ -78,7 +78,7 @@ QuicRangeGrow(
QUIC_SUBRANGE* NewSubRanges = QUIC_ALLOC_NONPAGED(NewAllocSize);
if (NewSubRanges == NULL) {
EventWriteQuicAllocFailure("range (realloc)", NewAllocLength);
QuicTraceEvent(AllocFailure, "range (realloc)", NewAllocLength);
return FALSE;
}

Просмотреть файл

@ -65,7 +65,7 @@ QuicRecvBufferInitialize(
RecvBuffer->Buffer = QUIC_ALLOC_NONPAGED(AllocBufferLength);
if (RecvBuffer->Buffer == NULL) {
EventWriteQuicAllocFailure("recv_buffer", AllocBufferLength);
QuicTraceEvent(AllocFailure, "recv_buffer", AllocBufferLength);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -75,7 +75,7 @@ QuicRecvBufferInitialize(
QUIC_MAX_RANGE_ALLOC_SIZE,
&RecvBuffer->WrittenRanges);
if (QUIC_FAILED(Status)) {
EventWriteQuicAllocFailure("recv_buffer written ranged", QUIC_MAX_RANGE_ALLOC_SIZE);
QuicTraceEvent(AllocFailure, "recv_buffer written ranged", QUIC_MAX_RANGE_ALLOC_SIZE);
QUIC_FREE(RecvBuffer->Buffer);
goto Error;
}
@ -324,7 +324,7 @@ QuicRecvBufferWrite(
BufferLength,
&WrittenRangesUpdated);
if (!UpdatedRange) {
EventWriteQuicAllocFailure("recv_buffer range", 0);
QuicTraceEvent(AllocFailure, "recv_buffer range", 0);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
} else if (!WrittenRangesUpdated) {

Просмотреть файл

@ -40,14 +40,14 @@ QuicRegistrationAlloc(
size_t AppNameLength = AppName == NULL ? 0 : strlen(AppName);
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_REGISTRATION_OPEN,
NULL);
QUIC_REGISTRATION* Registration =
QUIC_ALLOC_NONPAGED(sizeof(QUIC_REGISTRATION) + AppNameLength + 1);
if (Registration == NULL) {
EventWriteQuicAllocFailure("registration", sizeof(QUIC_REGISTRATION) + AppNameLength + 1);
QuicTraceEvent(AllocFailure, "registration", sizeof(QUIC_REGISTRATION) + AppNameLength + 1);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -98,13 +98,13 @@ QuicRegistrationAlloc(
goto Error;
}
EventWriteQuicRegistrationCreated(Registration, Registration->AppName);
QuicTraceEvent(RegistrationCreated, Registration, Registration->AppName);
#ifdef QuicVerifierEnabledByAddr
if (MsQuicLib.IsVerifying &&
QuicVerifierEnabledByAddr(NewRegistration)) {
Registration->IsVerifying = TRUE;
LogInfo("[ reg][%p] Verifing enabled!", Registration);
QuicTraceLogInfo("[ reg][%p] Verifing enabled!", Registration);
} else {
Registration->IsVerifying = FALSE;
}
@ -125,7 +125,7 @@ Error:
QUIC_FREE(Registration);
}
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -193,14 +193,14 @@ MsQuicRegistrationClose(
return;
}
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_REGISTRATION_CLOSE,
Handle);
#pragma prefast(suppress: __WARNING_25024, "Pointer cast already validated.")
QUIC_REGISTRATION* Registration = (QUIC_REGISTRATION*)Handle;
EventWriteQuicRegistrationCleanup(Registration);
QuicTraceEvent(RegistrationCleanup, Registration);
//
// If you hit this assert, you are trying to clean up a registration without
@ -224,7 +224,7 @@ MsQuicRegistrationClose(
QUIC_FREE(Registration);
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -233,7 +233,7 @@ QuicRegistrationTraceRundown(
_In_ QUIC_REGISTRATION* Registration
)
{
EventWriteQuicRegistrationRundown(Registration, Registration->AppName);
QuicTraceEvent(RegistrationRundown, Registration, Registration->AppName);
QuicLockAcquire(&Registration->Lock);
@ -279,7 +279,7 @@ MsQuicSecConfigCreate(
{
QUIC_STATUS Status;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SEC_CONFIG_CREATE,
Handle);
@ -301,7 +301,7 @@ MsQuicSecConfigCreate(
Exit:
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -313,7 +313,7 @@ MsQuicSecConfigDelete(
_In_ _Pre_defensive_ QUIC_SEC_CONFIG* SecurityConfig
)
{
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SEC_CONFIG_DELETE,
SecurityConfig);
@ -321,7 +321,7 @@ MsQuicSecConfigDelete(
QuicTlsSecConfigRelease(SecurityConfig);
}
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(PASSIVE_LEVEL)

Просмотреть файл

@ -83,7 +83,7 @@ QuicSendReset(
Send->SendFlags = 0;
Send->LastFlushTime = 0;
if (Send->DelayedAckTimerActive) {
LogVerbose("[send][%p] Canceling ACK_DELAY timer", QuicSendGetConnection(Send));
QuicTraceLogConnVerbose(CancelAckDelayTimer, QuicSendGetConnection(Send), "Canceling ACK_DELAY timer");
QuicConnTimerCancel(QuicSendGetConnection(Send), QUIC_CONN_TIMER_ACK_DELAY);
Send->DelayedAckTimerActive = FALSE;
}
@ -135,7 +135,7 @@ QuicSendQueueFlush(
"StreamID",
"AmpProtect"
};
LogVerbose("[send][%p] Queuing flush (%s)", Connection, ReasonStrings[Reason]);
QuicTraceLogConnVerbose(QueueSendFlush, Connection, "Queuing send flush (%s)", ReasonStrings[Reason]);
QuicConnQueueOper(Connection, Oper);
}
}
@ -189,14 +189,14 @@ QuicSendSetSendFlag(
!QuicConnIsClosed(Connection) || IsCloseFrame;
if (SendFlags & QUIC_CONN_SEND_FLAG_ACK && Send->DelayedAckTimerActive) {
LogVerbose("[send][%p] Canceling ACK_DELAY timer", Connection);
QuicTraceLogConnVerbose(CancelAckDelayTimer, Connection, "Canceling ACK_DELAY timer");
QuicConnTimerCancel(Connection, QUIC_CONN_TIMER_ACK_DELAY);
Send->DelayedAckTimerActive = FALSE;
}
if (CanSetFlag && (Send->SendFlags & SendFlags) != SendFlags) {
LogVerbose("[send][%p] Scheduling flags 0x%x to 0x%x",
Connection, SendFlags, Send->SendFlags);
QuicTraceLogConnVerbose(ScheduleSendFlags, Connection, "Scheduling flags 0x%x to 0x%x",
SendFlags, Send->SendFlags);
Send->SendFlags |= SendFlags;
QuicSendQueueFlush(Send, REASON_CONNECTION_FLAGS);
}
@ -237,7 +237,7 @@ QuicSendClearSendFlag(
)
{
if (Send->SendFlags & SendFlags) {
LogVerbose("[send][%p] Removing flags %x", QuicSendGetConnection(Send),
QuicTraceLogConnVerbose(RemoveSendFlags, QuicSendGetConnection(Send), "Removing flags %x",
(SendFlags & Send->SendFlags));
Send->SendFlags &= ~SendFlags;
}
@ -267,7 +267,7 @@ QuicSendUpdateAckState(
QUIC_DBG_ASSERT(!Send->DelayedAckTimerActive);
Send->SendFlags &= ~QUIC_CONN_SEND_FLAG_ACK;
} else if (Send->DelayedAckTimerActive) {
LogVerbose("[send][%p] Canceling ACK_DELAY timer", Connection);
QuicTraceLogConnVerbose(CancelAckDelayTimer, Connection, "Canceling ACK_DELAY timer");
QuicConnTimerCancel(Connection, QUIC_CONN_TIMER_ACK_DELAY);
Send->DelayedAckTimerActive = FALSE;
}
@ -317,7 +317,7 @@ QuicSendSetStreamSendFlag(
if ((Stream->SendFlags | SendFlags) != Stream->SendFlags) {
LogVerbose("[strm][%p][%llu] Setting flags 0x%x (existing flags: 0x%x)",
QuicTraceLogVerbose("[strm][%p][%llu] Setting flags 0x%x (existing flags: 0x%x)",
Stream, Stream->ID, (SendFlags & (~Stream->SendFlags)), Stream->SendFlags);
if ((Stream->SendFlags & SendFlags) != SendFlags) {
@ -358,7 +358,7 @@ QuicSendClearStreamSendFlag(
if (Stream->SendFlags & SendFlags) {
LogVerbose("[strm][%p][%llu] Removing flags %x",
QuicTraceLogVerbose("[strm][%p][%llu] Removing flags %x",
Stream, Stream->ID, (SendFlags & Stream->SendFlags));
//
@ -907,12 +907,12 @@ QuicSendFlush(
}
_Analysis_assume_(Builder.Metadata != NULL);
LogVerbose("[send][%p] Flushing send. Allowance=%u bytes", Connection, Builder.SendAllowance);
QuicTraceLogConnVerbose(FlushSend, Connection, "Flushing send. Allowance=%u bytes", Builder.SendAllowance);
do {
if (Path->Allowance < QUIC_MIN_SEND_ALLOWANCE) {
LogVerbose("[conn][%p] Cannot send any more because of amplification protection", Connection);
QuicTraceLogConnVerbose(AmplificationProtectionBlocked, Connection, "Cannot send any more because of amplification protection");
Result = QUIC_SEND_COMPLETE;
break;
}
@ -934,8 +934,8 @@ QuicSendFlush(
// The current pacing chunk is finished. We need to schedule a
// new pacing send.
//
LogVerbose("[send][%p] Setting delayed send (PACING) timer for %u ms",
Connection, QUIC_SEND_PACING_INTERVAL);
QuicTraceLogConnVerbose(SetPacingTimer, Connection, "Setting delayed send (PACING) timer for %u ms",
QUIC_SEND_PACING_INTERVAL);
QuicConnTimerSet(
Connection,
QUIC_CONN_TIMER_PACING,
@ -1051,7 +1051,7 @@ QuicSendFlush(
QuicPacketBuilderCleanup(&Builder);
LogVerbose("[send][%p] Flush complete flags=0x%x", Connection, Send->SendFlags);
QuicTraceLogConnVerbose(SendFlushComplete, Connection, "Flush complete flags=0x%x", Send->SendFlags);
return Result;
}
@ -1094,8 +1094,8 @@ QuicSendStartDelayedAckTimer(
!Connection->State.ClosedLocally &&
!Connection->State.ClosedRemotely) {
LogVerbose("[send][%p] Starting ACK_DELAY timer for %u ms",
Connection, Connection->MaxAckDelayMs);
QuicTraceLogConnVerbose(StartAckDelayTimer, Connection, "Starting ACK_DELAY timer for %u ms",
Connection->MaxAckDelayMs);
QuicConnTimerSet(
Connection,
QUIC_CONN_TIMER_ACK_DELAY,
@ -1145,6 +1145,6 @@ QuicSendOnMtuProbePacketAcked(
PacketSizeFromUdpPayloadSize(
QuicAddrGetFamily(&Path->RemoteAddress),
Packet->PacketLength);
LogInfo("[conn][%p] Path[%hu] MTU updated to %u bytes",
QuicSendGetConnection(Send), Path->ID, Path->Mtu);
QuicTraceLogConnInfo(PathMtuUpdated, QuicSendGetConnection(Send), "Path[%hu] MTU updated to %u bytes",
Path->ID, Path->Mtu);
}

Просмотреть файл

@ -91,7 +91,7 @@ QuicSendBufferAlloc(
if (Buf != NULL) {
SendBuffer->BufferedBytes += Size;
} else {
EventWriteQuicAllocFailure("sendbuffer", Size);
QuicTraceEvent(AllocFailure, "sendbuffer", Size);
}
return Buf;
@ -206,7 +206,7 @@ QuicSendBufferStreamAdjust(
QUIC_STREAM_EVENT Event;
Event.Type = QUIC_STREAM_EVENT_IDEAL_SEND_BUFFER_SIZE;
Event.IDEAL_SEND_BUFFER_SIZE.ByteCount = ByteCount;
LogVerbose("[strm][%p] Indicating QUIC_STREAM_EVENT_IDEAL_SEND_BUFFER_SIZE = %llu",
QuicTraceLogVerbose("[strm][%p] Indicating QUIC_STREAM_EVENT_IDEAL_SEND_BUFFER_SIZE = %llu",
Stream, Event.IDEAL_SEND_BUFFER_SIZE.ByteCount);
(void)QuicStreamIndicateEvent(Stream, &Event);
}

Просмотреть файл

@ -33,7 +33,7 @@ MsQuicSessionOpen(
QUIC_SESSION* Session = NULL;
size_t AlpnLength = 0;
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SESSION_OPEN,
RegistrationContext);
@ -53,7 +53,7 @@ MsQuicSessionOpen(
Session = QUIC_ALLOC_NONPAGED(sizeof(QUIC_SESSION) + AlpnLength + 1);
if (Session == NULL) {
EventWriteQuicAllocFailure("session", sizeof(QUIC_SESSION) + AlpnLength + 1);
QuicTraceEvent(AllocFailure, "session", sizeof(QUIC_SESSION) + AlpnLength + 1);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -67,14 +67,14 @@ MsQuicSessionOpen(
QuicCopyMemory(Session->Alpn, Alpn, AlpnLength + 1);
if (!QuicHashtableInitializeEx(&Session->ServerCache, QUIC_HASH_MIN_SIZE)) {
EventWriteQuicSessionError(Session, "Server cache initialize");
QuicTraceEvent(SessionError, Session, "Server cache initialize");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
Status = QuicTlsSessionInitialize(Session->Alpn, &Session->TlsSession);
if (QUIC_FAILED(Status)) {
EventWriteQuicSessionErrorStatus(Session, Status, "QuicTlsSessionInitialize");
QuicTraceEvent(SessionErrorStatus, Session, Status, "QuicTlsSessionInitialize");
QuicHashtableUninitialize(&Session->ServerCache);
goto Error;
}
@ -88,7 +88,7 @@ MsQuicSessionOpen(
Session->CompartmentId = QuicCompartmentIdGetCurrent();
#endif
EventWriteQuicSessionCreated(Session, Session->Registration, Alpn);
QuicTraceEvent(SessionCreated, Session, Session->Registration, Alpn);
QuicRundownInitialize(&Session->Rundown);
QuicRwLockInitialize(&Session->ServerCacheLock);
@ -108,7 +108,7 @@ MsQuicSessionOpen(
Session,
&Session->Storage);
if (QUIC_FAILED(Status)) {
LogWarning("[sess][%p] Failed to open settings, 0x%x", Session, Status);
QuicTraceLogWarning("[sess][%p] Failed to open settings, 0x%x", Session, Status);
Status = QUIC_STATUS_SUCCESS; // Non-fatal, as the process may not have access
}
}
@ -127,7 +127,7 @@ MsQuicSessionOpen(
Session,
&Session->AppSpecificStorage);
if (QUIC_FAILED(Status)) {
LogWarning("[sess][%p] Failed to open app specific settings, 0x%x", Session, Status);
QuicTraceLogWarning("[sess][%p] Failed to open app specific settings, 0x%x", Session, Status);
Status = QUIC_STATUS_SUCCESS; // Non-fatal, as the process may not have access
}
}
@ -147,7 +147,7 @@ Error:
QUIC_FREE(Session);
}
EventWriteQuicApiExitStatus(Status);
QuicTraceEvent(ApiExitStatus, Status);
return Status;
}
@ -170,14 +170,14 @@ MsQuicSessionClose(
return;
}
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SESSION_CLOSE,
Handle);
#pragma prefast(suppress: __WARNING_25024, "Pointer cast already validated.")
QUIC_SESSION* Session = (QUIC_SESSION*)Handle;
EventWriteQuicSessionCleanup(Session);
QuicTraceEvent(SessionCleanup, Session);
QuicLockAcquire(&Session->Registration->Lock);
QuicListEntryRemove(&Session->Link);
@ -231,9 +231,9 @@ MsQuicSessionClose(
#endif
QUIC_FREE(Session);
EventWriteQuicSessionDestroyed(Session);
QuicTraceEvent(SessionDestroyed, Session);
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -252,7 +252,7 @@ MsQuicSessionShutdown(
return;
}
EventWriteQuicApiEnter(
QuicTraceEvent(ApiEnter,
QUIC_TRACE_API_SESSION_SHUTDOWN,
Handle);
@ -260,7 +260,7 @@ MsQuicSessionShutdown(
#pragma prefast(suppress: __WARNING_25024, "Pointer cast already validated.")
QUIC_SESSION* Session = (QUIC_SESSION*)Handle;
EventWriteQuicSessionShutdown(Session, Flags, ErrorCode);
QuicTraceEvent(SessionShutdown, Session, Flags, ErrorCode);
QuicDispatchLockAcquire(&Session->ConnectionsLock);
@ -289,7 +289,7 @@ MsQuicSessionShutdown(
QuicDispatchLockRelease(&Session->ConnectionsLock);
}
EventWriteQuicApiExit();
QuicTraceEvent(ApiExit);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -298,7 +298,7 @@ QuicSessionTraceRundown(
_In_ QUIC_SESSION* Session
)
{
EventWriteQuicSessionRundown(Session, Session->Registration, Session->Alpn);
QuicTraceEvent(SessionRundown, Session, Session->Registration, Session->Alpn);
QuicDispatchLockAcquire(&Session->ConnectionsLock);
@ -334,7 +334,7 @@ QuicSessionSettingsChanged(
QuicSettingsLoad(&Session->Settings, Session->AppSpecificStorage);
}
LogInfo("[sess][%p] Settings %p Updated", Session, &Session->Settings);
QuicTraceLogInfo("[sess][%p] Settings %p Updated", Session, &Session->Settings);
QuicSettingsDump(&Session->Settings);
}
@ -353,7 +353,7 @@ QuicSessionRegisterConnection(
QuicConnApplySettings(Connection, &Session->Settings);
EventWriteQuicConnRegisterSession(Connection, Session);
QuicTraceEvent(ConnRegisterSession, Connection, Session);
BOOLEAN Success = QuicRundownAcquire(&Session->Rundown);
QUIC_DBG_ASSERT(Success); UNREFERENCED_PARAMETER(Success);
QuicDispatchLockAcquire(&Session->ConnectionsLock);
@ -369,7 +369,7 @@ QuicSessionUnregisterConnection(
)
{
Connection->Session = NULL;
EventWriteQuicConnUnregisterSession(Connection, Session);
QuicTraceEvent(ConnUnregisterSession, Connection, Session);
QuicDispatchLockAcquire(&Session->ConnectionsLock);
QuicListEntryRemove(&Connection->SessionLink);
QuicDispatchLockRelease(&Session->ConnectionsLock);
@ -491,7 +491,7 @@ QuicSessionServerCacheSetStateInternal(
QuicHashtableInsert(&Session->ServerCache, &Cache->Entry, Hash, NULL);
} else {
EventWriteQuicAllocFailure("server cache entry", sizeof(QUIC_SERVER_CACHE) + ServerNameLength);
QuicTraceEvent(AllocFailure, "server cache entry", sizeof(QUIC_SERVER_CACHE) + ServerNameLength);
}
}
@ -671,7 +671,7 @@ QuicSessionParamSet(
Session->Settings.AppSet.BidiStreamCount = TRUE;
Session->Settings.BidiStreamCount = *(uint16_t*)Buffer;
LogInfo("[sess][%p] Updated bidirectional stream count = %hu",
QuicTraceLogInfo("[sess][%p] Updated bidirectional stream count = %hu",
Session, Session->Settings.BidiStreamCount);
Status = QUIC_STATUS_SUCCESS;
@ -688,7 +688,7 @@ QuicSessionParamSet(
Session->Settings.AppSet.UnidiStreamCount = TRUE;
Session->Settings.UnidiStreamCount = *(uint16_t*)Buffer;
LogInfo("[sess][%p] Updated unidirectional stream count = %hu",
QuicTraceLogInfo("[sess][%p] Updated unidirectional stream count = %hu",
Session, Session->Settings.UnidiStreamCount);
Status = QUIC_STATUS_SUCCESS;
@ -705,7 +705,7 @@ QuicSessionParamSet(
Session->Settings.AppSet.IdleTimeoutMs = TRUE;
Session->Settings.IdleTimeoutMs = *(uint64_t*)Buffer;
LogInfo("[sess][%p] Updated idle timeout to %llu milliseconds",
QuicTraceLogInfo("[sess][%p] Updated idle timeout to %llu milliseconds",
Session, Session->Settings.IdleTimeoutMs);
Status = QUIC_STATUS_SUCCESS;
@ -722,7 +722,7 @@ QuicSessionParamSet(
Session->Settings.AppSet.DisconnectTimeoutMs = TRUE;
Session->Settings.DisconnectTimeoutMs = *(uint32_t*)Buffer;
LogInfo("[sess][%p] Updated disconnect timeout to %u milliseconds",
QuicTraceLogInfo("[sess][%p] Updated disconnect timeout to %u milliseconds",
Session, Session->Settings.DisconnectTimeoutMs);
Status = QUIC_STATUS_SUCCESS;
@ -779,7 +779,7 @@ QuicSessionParamSet(
Session->Settings.AppSet.MaxBytesPerKey = TRUE;
Session->Settings.MaxBytesPerKey = NewValue;
LogInfo("[sess][%p] Updated max bytes per key to %llu bytes",
QuicTraceLogInfo("[sess][%p] Updated max bytes per key to %llu bytes",
Session,
Session->Settings.MaxBytesPerKey);

Просмотреть файл

@ -398,25 +398,25 @@ QuicSettingsDump(
_In_ const QUIC_SETTINGS* Settings
)
{
LogVerbose("[sett] PacingDefault = %hu", (uint16_t)Settings->PacingDefault);
LogVerbose("[sett] MaxPartitionCount = %hu", (uint16_t)Settings->MaxPartitionCount);
LogVerbose("[sett] MaxOperationsPerDrain = %hu", (uint16_t)Settings->MaxOperationsPerDrain);
LogVerbose("[sett] RetryMemoryLimit = %hu", Settings->RetryMemoryLimit);
LogVerbose("[sett] MaxStatelessOperations = %u", Settings->MaxStatelessOperations);
LogVerbose("[sett] MaxWorkerQueueDelayUs = %u", Settings->MaxWorkerQueueDelayUs);
LogVerbose("[sett] InitialWindowPackets = %u", Settings->InitialWindowPackets);
LogVerbose("[sett] SendIdleTimeoutMs = %u", Settings->SendIdleTimeoutMs);
LogVerbose("[sett] InitialRttMs = %u", Settings->InitialRttMs);
LogVerbose("[sett] MaxAckDelayMs = %u", Settings->MaxAckDelayMs);
LogVerbose("[sett] DisconnectTimeoutMs = %u", Settings->DisconnectTimeoutMs);
LogVerbose("[sett] KeepAliveIntervalMs = %u", Settings->KeepAliveIntervalMs);
LogVerbose("[sett] IdleTimeoutMs = %llu", Settings->IdleTimeoutMs);
LogVerbose("[sett] BidiStreamCount = %hu", Settings->BidiStreamCount);
LogVerbose("[sett] UnidiStreamCount = %hu", Settings->UnidiStreamCount);
LogVerbose("[sett] TlsClientMaxSendBuffer = %u", Settings->TlsClientMaxSendBuffer);
LogVerbose("[sett] TlsServerMaxSendBuffer = %u", Settings->TlsServerMaxSendBuffer);
LogVerbose("[sett] StreamRecvWindowDefault= %u", Settings->StreamRecvWindowDefault);
LogVerbose("[sett] StreamRecvBufferDefault= %u", Settings->StreamRecvBufferDefault);
LogVerbose("[sett] ConnFlowControlWindow = %u", Settings->ConnFlowControlWindow);
LogVerbose("[sett] MaxBytesPerKey = %llu", Settings->MaxBytesPerKey);
QuicTraceLogVerbose("[sett] PacingDefault = %hu", (uint16_t)Settings->PacingDefault);
QuicTraceLogVerbose("[sett] MaxPartitionCount = %hu", (uint16_t)Settings->MaxPartitionCount);
QuicTraceLogVerbose("[sett] MaxOperationsPerDrain = %hu", (uint16_t)Settings->MaxOperationsPerDrain);
QuicTraceLogVerbose("[sett] RetryMemoryLimit = %hu", Settings->RetryMemoryLimit);
QuicTraceLogVerbose("[sett] MaxStatelessOperations = %u", Settings->MaxStatelessOperations);
QuicTraceLogVerbose("[sett] MaxWorkerQueueDelayUs = %u", Settings->MaxWorkerQueueDelayUs);
QuicTraceLogVerbose("[sett] InitialWindowPackets = %u", Settings->InitialWindowPackets);
QuicTraceLogVerbose("[sett] SendIdleTimeoutMs = %u", Settings->SendIdleTimeoutMs);
QuicTraceLogVerbose("[sett] InitialRttMs = %u", Settings->InitialRttMs);
QuicTraceLogVerbose("[sett] MaxAckDelayMs = %u", Settings->MaxAckDelayMs);
QuicTraceLogVerbose("[sett] DisconnectTimeoutMs = %u", Settings->DisconnectTimeoutMs);
QuicTraceLogVerbose("[sett] KeepAliveIntervalMs = %u", Settings->KeepAliveIntervalMs);
QuicTraceLogVerbose("[sett] IdleTimeoutMs = %llu", Settings->IdleTimeoutMs);
QuicTraceLogVerbose("[sett] BidiStreamCount = %hu", Settings->BidiStreamCount);
QuicTraceLogVerbose("[sett] UnidiStreamCount = %hu", Settings->UnidiStreamCount);
QuicTraceLogVerbose("[sett] TlsClientMaxSendBuffer = %u", Settings->TlsClientMaxSendBuffer);
QuicTraceLogVerbose("[sett] TlsServerMaxSendBuffer = %u", Settings->TlsServerMaxSendBuffer);
QuicTraceLogVerbose("[sett] StreamRecvWindowDefault= %u", Settings->StreamRecvWindowDefault);
QuicTraceLogVerbose("[sett] StreamRecvBufferDefault= %u", Settings->StreamRecvBufferDefault);
QuicTraceLogVerbose("[sett] ConnFlowControlWindow = %u", Settings->ConnFlowControlWindow);
QuicTraceLogVerbose("[sett] MaxBytesPerKey = %llu", Settings->MaxBytesPerKey);
}

Просмотреть файл

@ -118,7 +118,7 @@ QuicStreamFree(
QuicPoolFree(&Stream->Connection->Worker->StreamPool, Stream);
if (WasStarted) {
EventWriteQuicStreamDestroyed(Stream);
QuicTraceEvent(StreamDestroyed, Stream);
}
}
@ -161,7 +161,7 @@ QuicStreamStart(
}
Stream->Flags.Started = TRUE;
EventWriteQuicStreamCreated(Stream, Stream->Connection, Stream->ID,
QuicTraceEvent(StreamCreated, Stream, Stream->Connection, Stream->ID,
(!QuicConnIsServer(Stream->Connection) ^ (Stream->ID & STREAM_ID_FLAG_IS_SERVER)));
if (Stream->Flags.Unidirectional) {
@ -190,8 +190,8 @@ QuicStreamStart(
}
}
EventWriteQuicStreamSendState(Stream, QuicStreamSendGetState(Stream));
EventWriteQuicStreamRecvState(Stream, QuicStreamRecvGetState(Stream));
QuicTraceEvent(StreamSendState, Stream, QuicStreamSendGetState(Stream));
QuicTraceEvent(StreamRecvState, Stream, QuicStreamRecvGetState(Stream));
if (Stream->Flags.SendEnabled) {
Stream->OutFlowBlockedReasons |= QUIC_FLOW_BLOCKED_APP;
@ -216,7 +216,7 @@ QuicStreamStart(
Stream->SendWindow = (uint32_t)min(Stream->MaxAllowedSendOffset, UINT32_MAX);
if (Stream->OutFlowBlockedReasons != 0) {
EventWriteQuicStreamOutFlowBlocked(Stream, Stream->OutFlowBlockedReasons);
QuicTraceEvent(StreamOutFlowBlocked, Stream, Stream->OutFlowBlockedReasons);
}
Exit:
@ -247,7 +247,7 @@ QuicStreamClose(
// connection.
//
LogWarning("[strm][%p][%llu] Closing handle without fully shutting down.",
QuicTraceLogWarning("[strm][%p][%llu] Closing handle without fully shutting down.",
Stream, Stream->ID);
//
@ -273,9 +273,9 @@ QuicStreamTraceRundown(
_In_ QUIC_STREAM* Stream
)
{
EventWriteQuicStreamRundown(Stream, Stream->Connection, Stream->ID,
QuicTraceEvent(StreamRundown, Stream, Stream->Connection, Stream->ID,
(!QuicConnIsServer(Stream->Connection) ^ (Stream->ID & STREAM_ID_FLAG_IS_SERVER)));
EventWriteQuicStreamOutFlowBlocked(Stream, Stream->OutFlowBlockedReasons);
QuicTraceEvent(StreamOutFlowBlocked, Stream, Stream->OutFlowBlockedReasons);
// TODO - More state dump.
}
@ -296,7 +296,7 @@ QuicStreamIndicateEvent(
Event);
uint64_t EndTime = QuicTimeUs64();
if (EndTime - StartTime > QUIC_MAX_CALLBACK_TIME_WARNING) {
LogWarning("strm][%p][%llu] App took excessive time (%llu us) in callback.",
QuicTraceLogWarning("strm][%p][%llu] App took excessive time (%llu us) in callback.",
Stream, Stream->ID, (EndTime - StartTime));
QUIC_TEL_ASSERTMSG_ARGS(
EndTime - StartTime < QUIC_MAX_CALLBACK_TIME_ERROR,
@ -307,7 +307,7 @@ QuicStreamIndicateEvent(
}
} else {
Status = QUIC_STATUS_INVALID_STATE;
LogWarning("[strm][%p][%llu] Event silently discarded.", Stream, Stream->ID);
QuicTraceLogWarning("[strm][%p][%llu] Event silently discarded.", Stream, Stream->ID);
}
return Status;
}
@ -323,7 +323,7 @@ QuicStreamIndicateStartComplete(
Event.Type = QUIC_STREAM_EVENT_START_COMPLETE;
Event.START_COMPLETE.Status = Status;
Event.START_COMPLETE.ID = Stream->ID;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_START_COMPLETE (0x%x)",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_START_COMPLETE (0x%x)",
Stream, Stream->ID, Status);
(void)QuicStreamIndicateEvent(Stream, &Event);
}
@ -339,7 +339,7 @@ QuicStreamIndicateShutdownComplete(
QUIC_STREAM_EVENT Event;
Event.Type = QUIC_STREAM_EVENT_SHUTDOWN_COMPLETE;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SHUTDOWN_COMPLETE",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SHUTDOWN_COMPLETE",
Stream, Stream->ID);
(void)QuicStreamIndicateEvent(Stream, &Event);

Просмотреть файл

@ -639,7 +639,7 @@ QuicStreamAddOutFlowBlockedReason(
{
if (!(Stream->OutFlowBlockedReasons & Reason)) {
Stream->OutFlowBlockedReasons |= Reason;
EventWriteQuicStreamOutFlowBlocked(Stream, Stream->OutFlowBlockedReasons);
QuicTraceEvent(StreamOutFlowBlocked, Stream, Stream->OutFlowBlockedReasons);
return TRUE;
}
return FALSE;
@ -654,7 +654,7 @@ QuicStreamRemoveOutFlowBlockedReason(
{
if ((Stream->OutFlowBlockedReasons & Reason)) {
Stream->OutFlowBlockedReasons &= ~Reason;
EventWriteQuicStreamOutFlowBlocked(Stream, Stream->OutFlowBlockedReasons);
QuicTraceEvent(StreamOutFlowBlocked, Stream, Stream->OutFlowBlockedReasons);
return TRUE;
}
return FALSE;

Просмотреть файл

@ -79,7 +79,7 @@ QuicStreamRecvShutdown(
Exit:
EventWriteQuicStreamRecvState(Stream, QuicStreamRecvGetState(Stream));
QuicTraceEvent(StreamRecvState, Stream, QuicStreamRecvGetState(Stream));
if (Silent) {
QuicStreamTryCompleteShutdown(Stream);
@ -102,7 +102,7 @@ QuicStreamRecvQueueFlush(
!Stream->Flags.ReceiveCallPending &&
!Stream->Flags.ReceiveFlushQueued) {
LogVerbose("[strm][%p][%llu] Queuing recv flush", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Queuing recv flush", Stream, Stream->ID);
QUIC_OPERATION* Oper;
if ((Oper = QuicOperationAlloc(Stream->Connection->Worker, QUIC_OPER_TYPE_FLUSH_STREAM_RECV)) != NULL) {
@ -111,7 +111,7 @@ QuicStreamRecvQueueFlush(
QuicConnQueueOper(Stream->Connection, Oper);
Stream->Flags.ReceiveFlushQueued = TRUE;
} else {
EventWriteQuicAllocFailure("Flush Stream Recv operation", 0);
QuicTraceEvent(AllocFailure, "Flush Stream Recv operation", 0);
}
}
}
@ -143,7 +143,7 @@ QuicStreamProcessResetFrame(
// The peer indicated a final offset less than what they have
// already sent to us. Kill the connection.
//
LogWarning("[strm][%p][%llu] Tried to reset at earlier final size!", Stream, Stream->ID);
QuicTraceLogWarning("[strm][%p][%llu] Tried to reset at earlier final size!", Stream, Stream->ID);
QuicConnTransportError(Stream->Connection, QUIC_ERROR_FINAL_SIZE_ERROR);
return;
@ -162,21 +162,21 @@ QuicStreamProcessResetFrame(
// The peer indicated a final offset more than allowed. Kill the
// connection.
//
LogWarning("[strm][%p][%llu] Tried to reset with too big final size!", Stream, Stream->ID);
QuicTraceLogWarning("[strm][%p][%llu] Tried to reset with too big final size!", Stream, Stream->ID);
QuicConnTransportError(Stream->Connection, QUIC_ERROR_FINAL_SIZE_ERROR);
return;
}
}
EventWriteQuicStreamRecvState(Stream, QuicStreamRecvGetState(Stream));
QuicTraceEvent(StreamRecvState, Stream, QuicStreamRecvGetState(Stream));
if (!Stream->Flags.SentStopSending) {
LogInfo("[strm][%p][%llu] Closed remotely (reset).", Stream, Stream->ID);
QuicTraceLogInfo("[strm][%p][%llu] Closed remotely (reset).", Stream, Stream->ID);
QUIC_STREAM_EVENT Event;
Event.Type = QUIC_STREAM_EVENT_PEER_SEND_ABORTED;
Event.PEER_SEND_ABORTED.ErrorCode = ErrorCode;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_PEER_SEND_ABORTED (0x%llX)",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_PEER_SEND_ABORTED (0x%llX)",
Stream, Stream->ID, ErrorCode);
(void)QuicStreamIndicateEvent(Stream, &Event);
}
@ -208,13 +208,13 @@ QuicStreamProcessStopSendingFrame(
// completely closed gracefully (i.e. our close has been acknowledged)
// or if we have already been reset (abortive closure).
//
LogInfo("[strm][%p][%llu] Closed locally (stop sending).", Stream, Stream->ID);
QuicTraceLogInfo("[strm][%p][%llu] Closed locally (stop sending).", Stream, Stream->ID);
Stream->Flags.ReceivedStopSending = TRUE;
QUIC_STREAM_EVENT Event;
Event.Type = QUIC_STREAM_EVENT_PEER_RECEIVE_ABORTED;
Event.PEER_RECEIVE_ABORTED.ErrorCode = ErrorCode;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_PEER_RECEIVE_ABORTED (0x%llX)",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_PEER_RECEIVE_ABORTED (0x%llX)",
Stream, Stream->ID, ErrorCode);
(void)QuicStreamIndicateEvent(Stream, &Event);
@ -242,7 +242,7 @@ QuicStreamProcessStreamFrame(
uint64_t EndOffset = Frame->Offset + Frame->Length;
if (Stream->Flags.RemoteNotAllowed) {
EventWriteQuicStreamError(Stream, "Receive on unidirectional stream");
QuicTraceEvent(StreamError, Stream, "Receive on unidirectional stream");
Status = QUIC_STATUS_INVALID_STATE;
goto Error;
}
@ -254,7 +254,7 @@ QuicStreamProcessStreamFrame(
// Ignore the data if we are already closed remotely. Likely means we received
// a copy of already processed data that was resent.
//
EventWriteQuicStreamError(Stream, "Receive after close");
QuicTraceEvent(StreamError, Stream, "Receive after close");
Status = QUIC_STATUS_SUCCESS;
goto Error;
}
@ -326,7 +326,7 @@ QuicStreamProcessStreamFrame(
QUIC_DBG_ASSERT(Stream->Connection->Send.OrderedStreamBytesReceived >= WriteLength);
if (QuicRecvBufferGetTotalLength(&Stream->RecvBuffer) == Stream->MaxAllowedRecvOffset) {
LogVerbose("[strm][%p][%llu] Flow control window exhausted!", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Flow control window exhausted!", Stream, Stream->ID);
}
if (EncryptedWith0Rtt) {
@ -357,16 +357,16 @@ QuicStreamProcessStreamFrame(
QuicStreamRecvQueueFlush(Stream);
}
LogVerbose("[strm][%p][%llu] Received %hu bytes, offset=%llu Ready=%hu",
QuicTraceLogVerbose("[strm][%p][%llu] Received %hu bytes, offset=%llu Ready=%hu",
Stream, Stream->ID, (uint16_t)Frame->Length, Frame->Offset, ReadyToDeliver);
Error:
if (Status == QUIC_STATUS_INVALID_PARAMETER) {
LogWarning("[strm][%p][%llu] Tried to write beyond end of buffer!", Stream, Stream->ID);
QuicTraceLogWarning("[strm][%p][%llu] Tried to write beyond end of buffer!", Stream, Stream->ID);
QuicConnTransportError(Stream->Connection, QUIC_ERROR_FINAL_SIZE_ERROR);
} else if (Status == QUIC_STATUS_BUFFER_TOO_SMALL) {
LogWarning("[strm][%p][%llu] Tried to write beyond flow control limit!", Stream, Stream->ID);
QuicTraceLogWarning("[strm][%p][%llu] Tried to write beyond flow control limit!", Stream, Stream->ID);
QuicConnTransportError(Stream->Connection, QUIC_ERROR_FLOW_CONTROL_ERROR);
}
@ -468,7 +468,7 @@ QuicStreamRecv(
return QUIC_STATUS_INVALID_PARAMETER;
}
LogVerbose("[strm][%p][%llu] Remote stream FC blocked (%llu).", Stream, Stream->ID, Frame.StreamDataLimit);
QuicTraceLogVerbose("[strm][%p][%llu] Remote stream FC blocked (%llu).", Stream, Stream->ID, Frame.StreamDataLimit);
QuicSendSetStreamSendFlag(
&Stream->Connection->Send,
@ -551,7 +551,7 @@ QuicStreamOnBytesDelivered(
// low.
//
LogVerbose("[strm][%p][%llu] Increasing max RX buffer size to %u (SRtt=%u; TimeNow=%u; LastUpdate=%u)",
QuicTraceLogVerbose("[strm][%p][%llu] Increasing max RX buffer size to %u (SRtt=%u; TimeNow=%u; LastUpdate=%u)",
Stream,
Stream->ID,
Stream->RecvBuffer.VirtualBufferLength * 2,
@ -581,7 +581,7 @@ QuicStreamOnBytesDelivered(
// Advance MaxAllowedRecvOffset.
//
LogVerbose("[strm][%p][%llu] Updating flow control window",
QuicTraceLogVerbose("[strm][%p][%llu] Updating flow control window",
Stream, Stream->ID);
QUIC_DBG_ASSERT(
@ -608,7 +608,7 @@ QuicStreamRecvFlush(
{
Stream->Flags.ReceiveFlushQueued = FALSE;
if (!Stream->Flags.ReceiveEnabled) {
LogVerbose("[strm][%p][%llu] Ignoring recv flush (recv disabled)", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Ignoring recv flush (recv disabled)", Stream, Stream->ID);
return;
}
@ -663,7 +663,7 @@ QuicStreamRecvFlush(
Event.RECEIVE.Flags |= QUIC_RECEIVE_FLAG_FIN;
}
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_RECEIVE [%llu bytes, %u buffers, 0x%x flags]",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_RECEIVE [%llu bytes, %u buffers, 0x%x flags]",
Stream, Stream->ID, Event.RECEIVE.TotalBufferLength, Event.RECEIVE.BufferCount, Event.RECEIVE.Flags);
QUIC_STATUS Status = QuicStreamIndicateEvent(Stream, &Event);
@ -746,7 +746,7 @@ QuicStreamReceiveComplete(
"App overflowed read buffer!");
Stream->Flags.ReceiveCallPending = FALSE;
LogVerbose("[strm][%p][%llu] Recv complete (%llu bytes).", Stream, Stream->ID, BufferLength);
QuicTraceLogVerbose("[strm][%p][%llu] Recv complete (%llu bytes).", Stream, Stream->ID, BufferLength);
//
// Reclaim any buffer space comsumed by the app.
@ -776,7 +776,7 @@ QuicStreamReceiveComplete(
// The application layer can't drain any more right now. Pause the
// receive callbacks until the application re-enables them.
//
EventWriteQuicStreamRecvState(Stream, QuicStreamRecvGetState(Stream));
QuicTraceEvent(StreamRecvState, Stream, QuicStreamRecvGetState(Stream));
return FALSE;
}
@ -797,11 +797,11 @@ QuicStreamReceiveComplete(
Stream->Flags.RemoteCloseFin = TRUE;
Stream->Flags.RemoteCloseAcked = TRUE;
EventWriteQuicStreamRecvState(Stream, QuicStreamRecvGetState(Stream));
QuicTraceEvent(StreamRecvState, Stream, QuicStreamRecvGetState(Stream));
QUIC_STREAM_EVENT Event;
Event.Type = QUIC_STREAM_EVENT_PEER_SEND_SHUTDOWN;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_PEER_SEND_SHUTDOWN",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_PEER_SEND_SHUTDOWN",
Stream, Stream->ID);
(void)QuicStreamIndicateEvent(Stream, &Event);
@ -845,7 +845,7 @@ QuicStreamRecvSetEnabledState(
// The application just resumed receive callbacks. Queue a
// flush receive operation to start draining the receive buffer.
//
EventWriteQuicStreamRecvState(Stream, QuicStreamRecvGetState(Stream));
QuicTraceEvent(StreamRecvState, Stream, QuicStreamRecvGetState(Stream));
QuicStreamRecvQueueFlush(Stream);
}
}

Просмотреть файл

@ -91,7 +91,7 @@ QuicStreamIndicateSendShutdownComplete(
QUIC_STREAM_EVENT Event;
Event.Type = QUIC_STREAM_EVENT_SEND_SHUTDOWN_COMPLETE;
Event.SEND_SHUTDOWN_COMPLETE.Graceful = GracefulShutdown;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_SHUTDOWN_COMPLETE",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_SHUTDOWN_COMPLETE",
Stream, Stream->ID);
(void)QuicStreamIndicateEvent(Stream, &Event);
}
@ -223,7 +223,7 @@ QuicStreamSendShutdown(
Exit:
EventWriteQuicStreamSendState(Stream, QuicStreamSendGetState(Stream));
QuicTraceEvent(StreamSendState, Stream, QuicStreamSendGetState(Stream));
if (Silent) {
QuicStreamTryCompleteShutdown(Stream);
@ -374,10 +374,10 @@ QuicStreamCompleteSendRequest(
Event.SEND_COMPLETE.ClientContext = SendRequest->ClientContext;
if (Canceled) {
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_COMPLETE [%p] (Canceled)",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_COMPLETE [%p] (Canceled)",
Stream, Stream->ID, SendRequest);
} else {
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_COMPLETE [%p]",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_COMPLETE [%p]",
Stream, Stream->ID, SendRequest);
}
@ -442,7 +442,7 @@ QuicStreamSendBufferRequest(
Event.Type = QUIC_STREAM_EVENT_SEND_COMPLETE;
Event.SEND_COMPLETE.Canceled = FALSE;
Event.SEND_COMPLETE.ClientContext = Req->ClientContext;
LogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_COMPLETE [%p]",
QuicTraceLogVerbose("[strm][%p][%llu] Indicating QUIC_STREAM_EVENT_SEND_COMPLETE [%p]",
Stream, Stream->ID, Req);
(void)QuicStreamIndicateEvent(Stream, &Event);
@ -521,7 +521,7 @@ QuicStreamSendFlush(
*Stream->SendRequestsTail = SendRequest;
Stream->SendRequestsTail = &SendRequest->Next;
LogVerbose("[strm][%p][%llu] Send Request [%p] queued with %llu bytes at offset %llu (flags 0x%x)",
QuicTraceLogVerbose("[strm][%p][%llu] Send Request [%p] queued with %llu bytes at offset %llu (flags 0x%x)",
Stream, Stream->ID, SendRequest, SendRequest->TotalLength,
SendRequest->StreamOffset, SendRequest->Flags);
@ -680,7 +680,7 @@ QuicStreamWriteOneFrame(
//
HeaderLength = QuicStreamFrameHeaderSize(&Frame);
if (*FrameBytes < HeaderLength) {
LogVerbose("[strm][%p][%llu] Can't squeeze in a frame (no room for header)", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Can't squeeze in a frame (no room for header)", Stream, Stream->ID);
*FramePayloadBytes = 0;
*FrameBytes = 0;
return;
@ -710,13 +710,13 @@ QuicStreamWriteOneFrame(
//
// No bytes, no immediate open and no FIN, so no frame.
//
LogVerbose("[strm][%p][%llu] No more frames", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] No more frames", Stream, Stream->ID);
*FramePayloadBytes = 0;
*FrameBytes = 0;
return;
}
LogVerbose("[strm][%p][%llu] Built stream frame, offset=%llu len=%lu fin=%d",
QuicTraceLogVerbose("[strm][%p][%llu] Built stream frame, offset=%llu len=%lu fin=%d",
Stream, Stream->ID, Frame.Offset, (uint16_t)Frame.Length, Frame.Fin);
uint16_t BufferLength = *FrameBytes;
@ -932,7 +932,7 @@ QuicStreamWriteStreamFrames(
Send->OrderedStreamBytesSent += Right - Stream->MaxSentLength;
QUIC_DBG_ASSERT(Send->OrderedStreamBytesSent <= Send->PeerMaxData);
if (Send->OrderedStreamBytesSent == Send->PeerMaxData) {
LogVerbose("[conn][%p] Connection flow control limit reached", Stream->Connection);
QuicTraceLogConnVerbose(ConnFCBlocked, Stream->Connection, "Connection flow control limit reached");
}
Stream->MaxSentLength = Right;
}
@ -1101,13 +1101,13 @@ QuicStreamOnLoss(
if ((FrameMetadata->Flags & QUIC_SENT_FRAME_FLAG_STREAM_OPEN) &&
!Stream->Flags.SendOpenAcked) {
AddSendFlags |= QUIC_STREAM_SEND_FLAG_OPEN;
LogVerbose("[strm][%p][%llu] Recovering open STREAM frame", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Recovering open STREAM frame", Stream, Stream->ID);
}
if ((FrameMetadata->Flags & QUIC_SENT_FRAME_FLAG_STREAM_FIN) &&
!Stream->Flags.FinAcked) {
AddSendFlags |= QUIC_STREAM_SEND_FLAG_FIN;
LogVerbose("[strm][%p][%llu] Recovering fin STREAM frame", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Recovering fin STREAM frame", Stream, Stream->ID);
}
//
@ -1185,7 +1185,7 @@ QuicStreamOnLoss(
if (UpdatedRecoveryWindow) {
LogVerbose("[strm][%p][%llu] Recovering offset %llu up to %llu",
QuicTraceLogVerbose("[strm][%p][%llu] Recovering offset %llu up to %llu",
Stream, Stream->ID, Start, End);
AddSendFlags |= QUIC_STREAM_SEND_FLAG_DATA;
}
@ -1228,13 +1228,13 @@ QuicStreamOnAck(
QUIC_DBG_ASSERT(FollowingOffset <= Stream->QueuedSendOffset);
LogVerbose("[strm][%p][%llu] Received ack for %d bytes, offset=%llu, FF=0x%hx",
QuicTraceLogVerbose("[strm][%p][%llu] Received ack for %d bytes, offset=%llu, FF=0x%hx",
Stream, Stream->ID, Length, Offset, FrameMetadata->Flags);
if (PacketFlags.KeyType == QUIC_PACKET_KEY_0_RTT &&
Stream->Sent0Rtt < FollowingOffset) {
Stream->Sent0Rtt = FollowingOffset;
LogVerbose("[strm][%p][%llu] Updated sent 0RTT length to %llu",
QuicTraceLogVerbose("[strm][%p][%llu] Updated sent 0RTT length to %llu",
Stream, Stream->ID, FollowingOffset);
}
@ -1311,7 +1311,7 @@ QuicStreamOnAck(
if (Stream->UnAckedOffset == Stream->QueuedSendOffset && Stream->Flags.FinAcked) {
QUIC_DBG_ASSERT(Stream->SendRequests == NULL);
LogVerbose("[strm][%p][%llu] Send queue completely drained.", Stream, Stream->ID);
QuicTraceLogVerbose("[strm][%p][%llu] Send queue completely drained.", Stream, Stream->ID);
//
// We have completely sent all that needs to be sent. Update the Stream
@ -1320,7 +1320,7 @@ QuicStreamOnAck(
//
if (!Stream->Flags.LocalCloseAcked) {
Stream->Flags.LocalCloseAcked = TRUE;
EventWriteQuicStreamSendState(Stream, QuicStreamSendGetState(Stream));
QuicTraceEvent(StreamSendState, Stream, QuicStreamSendGetState(Stream));
QuicStreamIndicateSendShutdownComplete(Stream, TRUE);
QuicStreamTryCompleteShutdown(Stream);
}
@ -1389,7 +1389,7 @@ QuicStreamOnResetAck(
{
if (!Stream->Flags.LocalCloseAcked) {
Stream->Flags.LocalCloseAcked = TRUE;
EventWriteQuicStreamSendState(Stream, QuicStreamSendGetState(Stream));
QuicTraceEvent(StreamSendState, Stream, QuicStreamSendGetState(Stream));
QuicStreamIndicateSendShutdownComplete(Stream, FALSE);
QuicStreamTryCompleteShutdown(Stream);
}
@ -1401,9 +1401,9 @@ QuicStreamSendDumpState(
_In_ QUIC_STREAM* Stream
)
{
if (LogVerboseEnabled()) {
if (QuicTraceLogVerboseEnabled()) {
LogVerbose("[strm][%p][%llu] SF:%hX FC:%llu QS:%llu MAX:%llu UNA:%llu NXT:%llu RECOV:%llu-%llu",
QuicTraceLogVerbose("[strm][%p][%llu] SF:%hX FC:%llu QS:%llu MAX:%llu UNA:%llu NXT:%llu RECOV:%llu-%llu",
Stream,
Stream->ID,
Stream->SendFlags,
@ -1419,12 +1419,12 @@ QuicStreamSendDumpState(
uint32_t i = 0;
QUIC_SUBRANGE* Sack;
while ((Sack = QuicRangeGetSafe(&Stream->SparseAckRanges, i++)) != NULL) {
LogVerbose("[strm][%p][%llu] unACKed: [%llu, %llu]",
QuicTraceLogVerbose("[strm][%p][%llu] unACKed: [%llu, %llu]",
Stream, Stream->ID, UnAcked, Sack->Low);
UnAcked = Sack->Low + Sack->Count;
}
if (UnAcked < Stream->MaxSentLength) {
LogVerbose("[strm][%p][%llu] unACKed: [%llu, %llu]",
QuicTraceLogVerbose("[strm][%p][%llu] unACKed: [%llu, %llu]",
Stream, Stream->ID, UnAcked, Stream->MaxSentLength);
}

Просмотреть файл

@ -96,7 +96,7 @@ QuicStreamSetInsertStream(
// Lazily initialize the hash table.
//
if (!QuicHashtableInitialize(&StreamSet->StreamTable, QUIC_HASH_MIN_SIZE)) {
EventWriteQuicAllocFailure("streamset hash table", 0);
QuicTraceEvent(AllocFailure, "streamset hash table", 0);
return FALSE;
}
}
@ -235,8 +235,7 @@ QuicStreamSetIndicateStreamsAvailable(
Event.STREAMS_AVAILABLE.UnidirectionalCount =
QuicStreamSetGetCountAvailable(StreamSet, Type | STREAM_ID_FLAG_IS_UNI_DIR);
LogVerbose("[conn][%p] Indicating QUIC_CONNECTION_EVENT_STREAMS_AVAILABLE [%u] [%u]",
Connection,
QuicTraceLogConnVerbose(IndicateStreamsAvailable, Connection, "Indicating QUIC_CONNECTION_EVENT_STREAMS_AVAILABLE [%u] [%u]",
Event.STREAMS_AVAILABLE.BidirectionalCount,
Event.STREAMS_AVAILABLE.UnidirectionalCount);
(void)QuicConnIndicateEvent(Connection, &Event);
@ -352,8 +351,8 @@ QuicStreamSetUpdateMaxStreams(
if (MaxStreams > Info->MaxTotalStreamCount) {
LogVerbose("[conn][%p] Peer updated max stream count (%hu, %llu).",
Connection, BidirectionalStreams, MaxStreams);
QuicTraceLogConnVerbose(PeerStreamCountsUpdated, Connection, "Peer updated max stream count (%hu, %llu).",
BidirectionalStreams, MaxStreams);
BOOLEAN FlushSend = FALSE;
if (StreamSet->StreamTable != NULL) {
@ -401,8 +400,8 @@ QuicStreamSetUpdateMaxCount(
QUIC_CONNECTION* Connection = QuicStreamSetGetConnection(StreamSet);
QUIC_STREAM_TYPE_INFO* Info = &StreamSet->Types[Type];
LogInfo("[conn][%p] App configured max stream count of %hu (type=%hu).",
Connection, Count, Type);
QuicTraceLogConnInfo(MaxStreamCountUpdated, Connection, "App configured max stream count of %hu (type=%hu).",
Count, Type);
if (!Connection->State.Started) {
Info->MaxTotalStreamCount = Count;
@ -558,7 +557,7 @@ QuicStreamSetGetStreamForPeer(
// Validate the stream ID isn't above the allowed max.
//
if (StreamCount > Info->MaxTotalStreamCount) {
EventWriteQuicConnError(Connection, "Peer used more streams than allowed");
QuicTraceEvent(ConnError, Connection, "Peer used more streams than allowed");
QuicConnTransportError(Connection, QUIC_ERROR_STREAM_LIMIT_ERROR);
*ProtocolViolation = TRUE;
return NULL;
@ -624,12 +623,12 @@ QuicStreamSetGetStreamForPeer(
Event.PEER_STREAM_STARTED.Stream = (HQUIC)Stream;
Event.PEER_STREAM_STARTED.Flags = StreamFlags;
LogVerbose("[conn][%p] Indicating QUIC_CONNECTION_EVENT_PEER_STREAM_STARTED [%p, 0x%x]",
Connection, Event.PEER_STREAM_STARTED.Stream, Event.PEER_STREAM_STARTED.Flags);
QuicTraceLogConnVerbose(IndicatePeerStreamStarted, Connection, "Indicating QUIC_CONNECTION_EVENT_PEER_STREAM_STARTED [%p, 0x%x]",
Event.PEER_STREAM_STARTED.Stream, Event.PEER_STREAM_STARTED.Flags);
Status = QuicConnIndicateEvent(Connection, &Event);
if (QUIC_FAILED(Status)) {
LogWarning("[strm][%p][%llu] New stream wasn't accepted, 0x%x",
QuicTraceLogWarning("[strm][%p][%llu] New stream wasn't accepted, 0x%x",
Stream, NewStreamId, Status);
QuicStreamClose(Stream);
Stream = NULL;
@ -648,7 +647,7 @@ QuicStreamSetGetStreamForPeer(
//
// Remote tried to open stream that it wasn't allowed to.
//
LogWarning("[conn][%p] Remote tried to open stream it wasn't allowed to open.", Connection);
QuicTraceEvent(ConnError, Connection, "Remote tried to open stream it wasn't allowed to open.");
QuicConnTransportError(Connection, QUIC_ERROR_PROTOCOL_VIOLATION);
*ProtocolViolation = TRUE;
}

Просмотреть файл

@ -80,7 +80,7 @@ QuicTimerWheelInitialize(
TimerWheel->Slots =
QUIC_ALLOC_NONPAGED(QUIC_TIMER_WHEEL_INITIAL_SLOT_COUNT * sizeof(QUIC_LIST_ENTRY));
if (TimerWheel->Slots == NULL) {
EventWriteQuicAllocFailure("timerwheel slots",
QuicTraceEvent(AllocFailure, "timerwheel slots",
QUIC_TIMER_WHEEL_INITIAL_SLOT_COUNT * sizeof(QUIC_LIST_ENTRY));
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -125,12 +125,12 @@ QuicTimerWheelResize(
QUIC_LIST_ENTRY* NewSlots =
QUIC_ALLOC_NONPAGED(NewSlotCount * sizeof(QUIC_LIST_ENTRY));
if (NewSlots == NULL) {
EventWriteQuicAllocFailure("timerwheel slots (realloc)",
QuicTraceEvent(AllocFailure, "timerwheel slots (realloc)",
NewSlotCount * sizeof(QUIC_LIST_ENTRY));
return;
}
LogVerbose("[time][%p] Resizing timer wheel (new slot count = %u).", TimerWheel, NewSlotCount);
QuicTraceLogVerbose("[time][%p] Resizing timer wheel (new slot count = %u).", TimerWheel, NewSlotCount);
for (uint32_t i = 0; i < NewSlotCount; ++i) {
QuicListInitializeHead(&NewSlots[i]);
@ -217,9 +217,9 @@ QuicTimerWheelUpdate(
}
if (TimerWheel->NextConnection == NULL) {
LogVerbose("[time][%p] Next Expiration = {NULL}.", TimerWheel);
QuicTraceLogVerbose("[time][%p] Next Expiration = {NULL}.", TimerWheel);
} else {
LogVerbose("[time][%p] Next Expiration = {%llu, %p}.",
QuicTraceLogVerbose("[time][%p] Next Expiration = {%llu, %p}.",
TimerWheel, TimerWheel->NextExpirationTime, TimerWheel->NextConnection);
}
}
@ -236,7 +236,7 @@ QuicTimerWheelRemoveConnection(
// If the connection was in the timer wheel, remove its entry in the
// doubly-link list.
//
LogVerbose("[time][%p] Removing Connection %p.", TimerWheel, Connection);
QuicTraceLogVerbose("[time][%p] Removing Connection %p.", TimerWheel, Connection);
QuicListEntryRemove(&Connection->TimerLink);
Connection->TimerLink.Flink = NULL;
TimerWheel->ConnectionCount--;
@ -282,7 +282,7 @@ QuicTimerWheelUpdateConnection(
// No more timers left, go ahead and invalidate its link.
//
Connection->TimerLink.Flink = NULL;
LogVerbose("[time][%p] Removing Connection %p.", TimerWheel, Connection);
QuicTraceLogVerbose("[time][%p] Removing Connection %p.", TimerWheel, Connection);
if (Connection == TimerWheel->NextConnection) {
QuicTimerWheelUpdate(TimerWheel);
@ -317,7 +317,7 @@ QuicTimerWheelUpdateConnection(
//
QuicListInsertHead(Entry, &Connection->TimerLink);
LogVerbose("[time][%p] Updating Connection %p.", TimerWheel, Connection);
QuicTraceLogVerbose("[time][%p] Updating Connection %p.", TimerWheel, Connection);
//
// Make sure the next expiration time/connection is still correct.
@ -325,7 +325,7 @@ QuicTimerWheelUpdateConnection(
if (ExpirationTime < TimerWheel->NextExpirationTime) {
TimerWheel->NextExpirationTime = ExpirationTime;
TimerWheel->NextConnection = Connection;
LogVerbose("[time][%p] Next Expiration = {%llu, %p}.",
QuicTraceLogVerbose("[time][%p] Next Expiration = {%llu, %p}.",
TimerWheel, ExpirationTime, Connection);
} else if (Connection == TimerWheel->NextConnection) {
QuicTimerWheelUpdate(TimerWheel);

Просмотреть файл

@ -74,7 +74,7 @@ struct PacketNumberTest : public WEX::TestClass<PacketNumberTest>
for (UINT8 i = 0; i < ARRAYSIZE(Entries); i++) {
VERIFY_ARE_EQUAL(
QuicPacketNumberDecompress(
QuicPktNumDecompress(
Entries[i].HighestReceived + 1,
Entries[i].Compressed,
Entries[i].CompressedBytes),

Просмотреть файл

@ -34,7 +34,7 @@ QuicLogBuffer(
if (Index + Length > BufferLength) {
Length = (uint16_t)(BufferLength - Index);
}
LogVerbose("%!HEXBUF!", LOG_HEXBUF(Buffer + Index, Length));
QuicTraceLogVerbose("%!HEXBUF!", LOG_HEXBUF(Buffer + Index, Length));
Index += QUIC_LOG_LINE_LENGTH;
}
}

Просмотреть файл

@ -41,7 +41,7 @@ QuicWorkerInitialize(
{
QUIC_STATUS Status;
EventWriteQuicWorkerCreated(Worker, IdealProcessor, Owner);
QuicTraceEvent(WorkerCreated, Worker, IdealProcessor, Owner);
Worker->Enabled = TRUE;
Worker->IdealProcessor = IdealProcessor;
@ -71,7 +71,7 @@ QuicWorkerInitialize(
Status = QuicThreadCreate(&ThreadConfig, &Worker->Thread);
if (QUIC_FAILED(Status)) {
EventWriteQuicWorkerErrorStatus(Worker, Status, "QuicThreadCreate");
QuicTraceEvent(WorkerErrorStatus, Worker, Status, "QuicThreadCreate");
Status = QUIC_STATUS_OUT_OF_MEMORY;
QuicTimerWheelUninitialize(&Worker->TimerWheel);
goto Error;
@ -101,7 +101,7 @@ QuicWorkerUninitialize(
_In_ QUIC_WORKER* Worker
)
{
EventWriteQuicWorkerCleanup(Worker);
QuicTraceEvent(WorkerCleanup, Worker);
//
// Prevent the thread from processing any more operations.
@ -128,7 +128,7 @@ QuicWorkerUninitialize(
QuicDispatchLockUninitialize(&Worker->Lock);
QuicTimerWheelUninitialize(&Worker->TimerWheel);
EventWriteQuicWorkerDestroyed(Worker);
QuicTraceEvent(WorkerDestroyed, Worker);
}
_IRQL_requires_max_(DISPATCH_LEVEL)
@ -140,7 +140,7 @@ QuicWorkerAssignConnection(
{
QUIC_DBG_ASSERT(Connection->Worker != Worker);
Connection->Worker = Worker;
EventWriteQuicConnAssignWorker(Connection, Worker);
QuicTraceEvent(ConnAssignWorker, Connection, Worker);
}
BOOLEAN
@ -168,7 +168,7 @@ QuicWorkerQueueConnection(
if (!Connection->WorkerProcessing && !Connection->HasQueuedWork) {
WakeWorkerThread = QuicWorkerIsIdle(Worker);
Connection->Stats.Schedule.LastQueueTime = QuicTimeUs32();
EventWriteQuicConnScheduleState(Connection, QUIC_SCHEDULE_QUEUED);
QuicTraceEvent(ConnScheduleState, Connection, QUIC_SCHEDULE_QUEUED);
QuicConnAddRef(Connection, QUIC_CONN_REF_WORKER);
QuicListInsertTail(&Worker->Connections, &Connection->WorkerLink);
} else {
@ -199,7 +199,7 @@ QuicWorkerMoveConnection(
if (Connection->HasQueuedWork) {
Connection->Stats.Schedule.LastQueueTime = QuicTimeUs32();
EventWriteQuicConnScheduleState(Connection, QUIC_SCHEDULE_QUEUED);
QuicTraceEvent(ConnScheduleState, Connection, QUIC_SCHEDULE_QUEUED);
QuicConnAddRef(Connection, QUIC_CONN_REF_WORKER);
QuicListInsertTail(&Worker->Connections, &Connection->WorkerLink);
}
@ -259,7 +259,7 @@ QuicWorkerToggleActivityState(
)
{
Worker->IsActive = !Worker->IsActive;
EventWriteQuicWorkerActivityStateUpdated(Worker, Worker->IsActive, Arg);
QuicTraceEvent(WorkerActivityStateUpdated, Worker, Worker->IsActive, Arg);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -270,7 +270,7 @@ QuicWorkerUpdateQueueDelay(
)
{
Worker->AverageQueueDelay = (7 * Worker->AverageQueueDelay + TimeInQueueUs) / 8;
EventWriteQuicWorkerQueueDelayUpdated(Worker, Worker->AverageQueueDelay);
QuicTraceEvent(WorkerQueueDelayUpdated, Worker, Worker->AverageQueueDelay);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -280,7 +280,7 @@ QuicWorkerResetQueueDelay(
)
{
Worker->AverageQueueDelay = 0;
EventWriteQuicWorkerQueueDelayUpdated(Worker, Worker->AverageQueueDelay);
QuicTraceEvent(WorkerQueueDelayUpdated, Worker, Worker->AverageQueueDelay);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -384,7 +384,7 @@ QuicWorkerProcessConnection(
_In_ QUIC_CONNECTION* Connection
)
{
EventWriteQuicConnScheduleState(Connection, QUIC_SCHEDULE_PROCESSING);
QuicTraceEvent(ConnScheduleState, Connection, QUIC_SCHEDULE_PROCESSING);
QuicSessionAttachSilo(Connection->Session);
if (Connection->Stats.Schedule.LastQueueTime != 0) {
@ -416,8 +416,7 @@ QuicWorkerProcessConnection(
QUIC_CONNECTION_EVENT Event;
Event.Type = QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED;
Event.IDEAL_PROCESSOR_CHANGED.IdealProcessor = Worker->IdealProcessor;
LogVerbose("[conn][%p] Indicating QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED",
Connection);
QuicTraceLogConnVerbose(IndicateIdealProcChanged, Connection, "Indicating QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED");
(void)QuicConnIndicateEvent(Connection, &Event);
}
@ -444,10 +443,10 @@ QuicWorkerProcessConnection(
if (Connection->HasQueuedWork) {
Connection->Stats.Schedule.LastQueueTime = QuicTimeUs32();
QuicListInsertTail(&Worker->Connections, &Connection->WorkerLink);
EventWriteQuicConnScheduleState(Connection, QUIC_SCHEDULE_QUEUED);
QuicTraceEvent(ConnScheduleState, Connection, QUIC_SCHEDULE_QUEUED);
DoneWithConnection = FALSE;
} else {
EventWriteQuicConnScheduleState(Connection, QUIC_SCHEDULE_IDLE);
QuicTraceEvent(ConnScheduleState, Connection, QUIC_SCHEDULE_IDLE);
}
}
QuicDispatchLockRelease(&Worker->Lock);
@ -483,7 +482,7 @@ QUIC_THREAD_CALLBACK(QuicWorkerThread, Context)
Worker->ThreadID = QuicCurThreadID();
Worker->IsActive = TRUE;
EventWriteQuicWorkerStart(Worker);
QuicTraceEvent(WorkerStart, Worker);
//
// TODO - Review how often QuicTimeUs64() is called in the thread. Perhaps
@ -588,7 +587,7 @@ QUIC_THREAD_CALLBACK(QuicWorkerThread, Context)
QuicOperationFree(Worker, Operation);
}
EventWriteQuicWorkerStop(Worker);
QuicTraceEvent(WorkerStop, Worker);
QUIC_THREAD_RETURN(QUIC_STATUS_SUCCESS);
}
@ -606,7 +605,7 @@ QuicWorkerPoolInitialize(
QUIC_WORKER_POOL* WorkerPool =
QUIC_ALLOC_NONPAGED(sizeof(QUIC_WORKER_POOL) + WorkerCount * sizeof(QUIC_WORKER));
if (WorkerPool == NULL) {
EventWriteQuicAllocFailure("QUIC_WORKER_POOL", sizeof(QUIC_WORKER_POOL) + WorkerCount * sizeof(QUIC_WORKER));
QuicTraceEvent(AllocFailure, "QUIC_WORKER_POOL", sizeof(QUIC_WORKER_POOL) + WorkerCount * sizeof(QUIC_WORKER));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}

Просмотреть файл

@ -47,6 +47,8 @@ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\S
- Install tooling
- `sudo apt-get install cmake`
- `sudo apt-get install build-essentials`
- `sudo apt-get install liblttng-ust-dev`
- `sudo apt-get install lttng-tools`
- Run `mkdir bld && cd bld`
- Run `cmake -G "Unix Makefiles" ..`
- Run `cmake --build . --config RELEASE`

Просмотреть файл

@ -133,268 +133,15 @@ QuicSysLogWrite(
...
);
#endif // defined(QUIC_EVENTS_SYSLOG) || defined(QUIC_TRACE_SYSLOG)
#endif // defined(QUIC_EVENTS_SYSLOG) || defined(QUIC_LOGS_SYSLOG)
#if defined(QUIC_EVENTS_STUB) || defined(QUIC_EVENTS_SYSLOG) || defined(QUIC_EVENTS_LTTNG)
#ifdef QUIC_EVENTS_STUB
#ifdef QUIC_EVENTS_SYSLOG
#define QUIC_WRITE_EVENT QuicSysLogWrite
#elif defined(QUIC_EVENTS_STUB)
#define QUIC_WRITE_EVENT(...)
#else // QUIC_EVENTS_LTTNG
#error "LTTng not supported yet!"
#endif
#define QuicTraceEventEnabled(Name) FALSE
#define QuicTraceEvent(Name, ...)
#define LOG_ADDR_LEN(Addr)
#define EventWriteQuicLibraryInitialized(PartitionCount, DatapathFeatures) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ lib] Initialized, PartitionCount=%u DatapathFeatures=%u", PartitionCount, DatapathFeatures)
#define EventWriteQuicLibraryUninitialized() \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ lib] Uninitialized")
#define EventWriteQuicLibraryAddRef() \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ lib] AddRef")
#define EventWriteQuicLibraryRelease() \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ lib] Release")
#define EventWriteQuicLibraryWorkerPoolInit() \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ lib] Shared worker pool initializing")
#define EventWriteQuicAllocFailure(Desc, ByteCount) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_WARNING, "Allocation of '%s' failed. (%llu bytes)")
#define EventWriteQuicLibraryRundown(PartitionCount, DatapathFeatures) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ lib] Rundown, PartitionCount=%u DatapathFeatures=%u", PartitionCount, DatapathFeatures)
#define EventWriteQuicLibraryError(ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ lib] ERROR, %s.", ErrStr)
#define EventWriteQuicLibraryErrorStatus(Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ lib] ERROR, 0x%x, %s.", Status, ErrStr)
#define EventWriteQuicLibraryAssert(Line, File, Expression) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ lib] ASSERT, %s:%u - %s.", File, Line, Expression)
#define EventWriteQuicApiEnter(Type, Handle) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Enter %u (%p).", Type, Handle)
#define EventWriteQuicApiExit() \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Exit")
#define EventWriteQuicApiExitStatus(Status) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Exit 0x%x", Status)
#define EventWriteQuicApiWaitOperation() \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Waiting on operation")
#define EventWriteQuicRegistrationCreated(Registration, AppName) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Created, AppName=%s", Registration, AppName)
#define EventWriteQuicRegistrationDestroyed(Registration) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Destroyed", Registration)
#define EventWriteQuicRegistrationCleanup(Registration) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Cleanup", Registration)
#define EventWriteQuicRegistrationRundown(Registration, AppName) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Rundown, AppName=%s", Registration, AppName)
#define EventWriteQuicRegistrationError(Registration, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ reg][%p] ERROR, %s", Registration, ErrStr)
#define EventWriteQuicRegistrationErrorStatus(Registration, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ reg][%p] ERROR, %u, %s", Registration, Status, ErrStr)
#define EventWriteQuicWorkerCreated(Worker, IdealProcessor, Owner) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Created, IdealProc=%u Owner=%p", Worker, IdealProcessor, Owner)
#define EventWriteQuicWorkerStart(Worker) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Start", Worker)
#define EventWriteQuicWorkerStop(Worker) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Stop", Worker)
#define EventWriteQuicWorkerActivityStateUpdated(Worker, IsActive, Arg) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[wrkr][%p] IsActive = %u, Arg = %u", IsActive, Arg)
#define EventWriteQuicWorkerQueueDelayUpdated(Worker, QueueDelay) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[wrkr][%p] QueueDelay: %u us", Worker, QueueDelay)
#define EventWriteQuicWorkerDestroyed(Worker) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Destroyed", Worker)
#define EventWriteQuicWorkerCleanup(Worker) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Cleanup", Worker)
#define EventWriteQuicWorkerError(Worker, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[wrkr][%p] ERROR, %s", Worker, ErrStr)
#define EventWriteQuicWorkerErrorStatus(Worker, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[wrkr][%p] ERROR, %u, %s", Worker, Status, ErrStr)
#define EventWriteQuicSessionCreated(Session, Registration, Alpn) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Created, Registration=%p, ALPN='%s'", Session, Registration, Alpn)
#define EventWriteQuicSessionDestroyed(Session) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Destroyed", Session)
#define EventWriteQuicSessionCleanup(Session) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Cleanup", Session)
#define EventWriteQuicSessionShutdown(Session, Flags, ErrorCode) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Shutdown, Flags=0x%x, ErrorCode=%llu", Session, Flags, ErrorCode)
#define EventWriteQuicSessionRundown(Session, Registration, Alpn) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Rundown, Registration=%p, ALPN='%s'", Session, Registration, Alpn)
#define EventWriteQuicSessionError(Session, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[sess][%p] ERROR, %s", Session, ErrStr)
#define EventWriteQuicSessionErrorStatus(Session, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[sess][%p] ERROR, %u, %s", Session, Status, ErrStr)
#define EventWriteQuicListenerCreated(Listener, Session) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[list][%p] Created, Session=%p", Listener, Session)
#define EventWriteQuicListenerDestroyed(Listener) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[list][%p] Destroyed", Listener)
#define EventWriteQuicListenerStarted(Listener, Binding, AddrLen, Addr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[list][%p] Started, Binding=%p, Addr=TODO", Listener, Binding)
#define EventWriteQuicListenerStopped(Listener) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[list][%p] Stopped", Listener)
#define EventWriteQuicListenerRundown(Listener, Session) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[list][%p] Rundown, Session=%p", Listener, Session)
#define EventWriteQuicListenerError(Listener, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[list][%p] ERROR, %s", Listener, ErrStr)
#define EventWriteQuicListenerErrorStatus(Listener, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[list][%p] ERROR, %u, %s", Listener, Status, ErrStr)
#define EventWriteQuicConnCreated(Connection, IsServer, CorrelationId) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Created, Server=%u, CorrelationId=%llu", Connection, IsServer, CorrelationId)
#define EventWriteQuicConnDestroyed(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Destroyed", Connection)
#define EventWriteQuicConnHandshakeComplete(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Handshake complete", Connection)
#define EventWriteQuicConnScheduleState(Connection, State) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Scheduling: %u", Connection, State)
#define EventWriteQuicConnExecOper(Connection, Type) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Execute: %u", Connection, Type)
#define EventWriteQuicConnExecApiOper(Connection, Type) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Execute: API %u", Connection, Type)
#define EventWriteQuicConnExecTimerOper(Connection, Type) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Execute: Timer %u", Connection, Type)
#define EventWriteQuicConnLocalAddrAdded(Connection, AddrLen, Addr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Local IP: TODO", Connection)
#define EventWriteQuicConnRemoteAddrAdded(Connection, AddrLen, Addr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Remote IP: TODO", Connection)
#define EventWriteQuicConnLocalAddrRemoved(Connection, AddrLen, Addr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Local IP: TODO", Connection)
#define EventWriteQuicConnRemoteAddrRemoved(Connection, AddrLen, Addr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Remote IP: TODO", Connection)
#define EventWriteQuicConnAssignWorker(Connection, Worker) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Assigned worker %p", Connection, Worker)
#define EventWriteQuicConnHandshakeStart(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Handshake start", Connection)
#define EventWriteQuicConnRegisterSession(Connection, Session) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Registered with session: %p", Connection, Session)
#define EventWriteQuicConnUnregisterSession(Connection, Session) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Unregistered from session: %p", Connection, Session)
#define EventWriteQuicConnTransportShutdown(Connection, ErrorCode, IsRemoteShutdown, IsQuicStatus) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Transport Shutdown: 0x%x (Remote=%u) (QS=%u)", Connection, ErrorCode, IsRemoteShutdown, IsQuicStatus)
#define EventWriteQuicConnAppShutdown(Connection, ErrorCode, IsRemoteShutdown) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] App Shutdown: 0x%x (Remote=%u)", ErrorCode, IsRemoteShutdown)
#define EventWriteQuicConnInitializeComplete(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Initialize complete", Connection)
#define EventWriteQuicConnHandleClosed(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Handle closed", Connection)
#define EventWriteQuicConnVersionSet(Connection, Value) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Version: 0x%x", Connection, Value)
#define EventWriteQuicConnOutFlowStats(Connection, BytesSent, BytesInFlight, BytesInFlightMax, CongestionWindow, SlowStartThreshold, ConnectionFlowControl, StreamFlowControl, IdealBytes, PostedBytes, SmoothedRtt, StreamSendWindow) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] OUT: BytesSent=%llu InFlight=%u InFlightMax=%u CWnd=%u SSThresh=%u ConnFC=%llu StreamFC=%llu ISB=%llu PostedBytes=%llu SRtt=%u StreamSndWnd=%llu", Connection, \
BytesSent, BytesInFlight, BytesInFlightMax, CongestionWindow, SlowStartThreshold, ConnectionFlowControl, StreamFlowControl, IdealBytes, PostedBytes, SmoothedRtt, StreamSendWindow)
#define EventWriteQuicConnOutFlowBlocked(Connection, ReasonFlags) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Send Blocked: 0x%x", Connection, ReasonFlags)
#define EventEnabledQuicConnOutFlowStats() TRUE
#define EventWriteQuicConnInFlowStats(Connection, BytesReceived) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] IN: BytesRecv=%llu", Connection, BytesReceived)
#define EventWriteQuicConnCubic(Connection, SlowStartThreshold, K, WindowMax, WindowLastMax) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] CUBIC: SlowStartThreshold=%u K=%u WindowMax=%u WindowLastMax=%u", Connection, SlowStartThreshold, K, WindowMax, WindowLastMax)
#define EventWriteQuicConnCongestion(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Congestion event", Connection)
#define EventWriteQuicConnPersistentCongestion(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Persistent congestion event", Connection)
#define EventWriteQuicConnRecoveryExit(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Recovery exit", Connection)
#define EventWriteQuicConnRundown(Connection, IsServer, CorrelationId) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Rundown, Server=%u, CorrelationId=%llu", Connection, IsServer, CorrelationId)
#define EventWriteQuicConnSourceCidAdded(Connection, CidLen, Cid) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Source CID: TODO", Connection)
#define EventWriteQuicConnDestCidAdded(Connection, CidLen, Cid) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Destination CID: TODO", Connection)
#define EventWriteQuicConnSourceCidRemoved(Connection, CidLen, Cid) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Source CID: TODO", Connection)
#define EventWriteQuicConnDestCidRemoved(Connection, CidLen, Cid) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Destination CID: TODO", Connection)
#define EventWriteQuicConnLossDetectionTimerSet(Connection, TimerType, DelayMs, ProbeCount) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Setting loss detection timer (type %u) for %u ms. (ProbeCount=%hu)", TimerType, DelayMs, ProbeCount)
#define EventWriteQuicConnLossDetectionTimerCancel(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Cancelling loss detection timer.", Connection)
#define EventWriteQuicConnDropPacket(Connection, PktNum, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s", Connection, PktNum, Reason)
#define EventWriteQuicConnDropPacketEx(Connection, PktNum, Value, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s, %u", Connection, PktNum, Reason, Value)
#define EventWriteQuicConnError(Connection, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[conn][%p] ERROR, %s", Connection, ErrStr)
#define EventWriteQuicConnErrorStatus(Connection, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[conn][%p] ERROR, %u, %s", Connection, Status, ErrStr)
#define EventWriteQuicConnNewPacketKeys(Connection) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New packet keys generated", Connection)
#define EventWriteQuicConnKeyPhaseChange(Connection, IsLocallyInitiated) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Key phase change, IsLocallyInitiated=%u", Connection, IsLocallyInitiated)
#define EventWriteQuicConnStatistics(Connection, LifeTimeUs, SendTotalPackets, SendSuspectedLostPackets, SendSpuriousLostPackets, RecvTotalPackets, RecvReorderedPackets, RecvDroppedPackets, RecvDuplicatePackets, RecvDecryptionFailures, CongestionCount, PersistentCongestionCount, SendTotalBytes, RecvTotalBytes, SmoothedRtt) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] STATS: LifeTimeUs=%llu SendTotalPackets=%llu SendSuspectedLostPackets=%llu SendSpuriousLostPackets=%llu RecvTotalPackets=%llu RecvReorderedPackets=%llu RecvDroppedPackets=%llu RecvDuplicatePackets=%llu RecvDecryptionFailures=%llu CongestionCount=%u PersistentCongestionCount=%u SendTotalBytes=%llu RecvTotalBytes=%llu SmoothedRtt=%u", \
Connection, LifeTimeUs, SendTotalPackets, SendSuspectedLostPackets, SendSpuriousLostPackets, RecvTotalPackets, RecvReorderedPackets, RecvDroppedPackets, RecvDuplicatePackets, RecvDecryptionFailures, CongestionCount, PersistentCongestionCount, SendTotalBytes, RecvTotalBytes, SmoothedRtt)
#define EventWriteQuicConnShutdownComplete(Connection, TimedOut) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Shutdown Complete, PeerFailedToAcknowledged=%u", Connection, TimedOut)
#define EventWriteQuicConnReadKeyUpdated(Connection, NewValue) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Read Key Updated, %u", Connection, NewValue)
#define EventWriteQuicConnWriteKeyUpdated(Connection, NewValue) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Write Key Updated, %u", Connection, NewValue)
#define EventWriteQuicConnPacketSent(Connection, Number, Type, Length) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [TX][%llu] %u (%hu bytes)", Connection, Number, Type, Length)
#define EventWriteQuicConnPacketRecv(Connection, Number, Type, Length) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [RX][%llu] %u (%hu bytes)", Connection, Number, Type, Length)
#define EventWriteQuicConnPacketLost(Connection, Number, Type, Reason) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [TX][%llu] %u Lost: %u", Connection, Number, Type, Reason)
#define EventWriteQuicConnPacketACKed(Connection, Number, Type) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [TX][%llu] %u ACKed", Connection, Number, Type)
#define EventWriteQuicStreamCreated(Stream, Connection, ID, IsLocalOwned) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Created, Connection=%p ID=%llu IsLocal=%hu", Stream, Connection, ID, IsLocalOwned)
#define EventWriteQuicStreamDestroyed(Stream) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Destroyed", Stream)
#define EventWriteQuicStreamOutFlowBlocked(Stream, ReasonFlags) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Send Blocked: 0x%x", Stream, ReasonFlags)
#define EventWriteQuicStreamRundown(Stream, Connection, ID, IsLocalOwned) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Rundown, Connection=%p ID=%llu IsLocal=%hu", Stream, Connection, ID, IsLocalOwned)
#define EventWriteQuicStreamSendState(Stream, State) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Send State: %u", Stream, State)
#define EventWriteQuicStreamRecvState(Stream, State) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Recv State: %u", Stream, State)
#define EventWriteQuicStreamError(Stream, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[strm][%p] ERROR, %s", Stream, ErrStr)
#define EventWriteQuicStreamErrorStatus(Stream, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[strm][%p] ERROR, %u, %s", Stream, Status, ErrStr)
#define EventWriteQuicBindingCreated(Binding, UdpBinding, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Created %p, Udp=%llX LocalAddr=TODO RemoteAddr=TODO", Binding, UdpBinding);\
UNREFERENCED_PARAMETER(RemoteAddr); UNREFERENCED_PARAMETER(LocalAddr)
#define EventWriteQuicBindingRundown(Binding, UdpBinding, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Rundown %p, Udp=%llX LocalAddr=TODO RemoteAddr=TODO", Binding, UdpBinding);\
UNREFERENCED_PARAMETER(RemoteAddr); UNREFERENCED_PARAMETER(LocalAddr)
#define EventWriteQuicBindingDestroyed(Binding) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Destroyed", Binding)
#define EventWriteQuicBindingCleanup(Binding) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Cleaning up", Binding)
#define EventWriteQuicBindingDropPacket(Binding, PktNum, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[bind][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s", Binding, PktNum, Reason)
#define EventWriteQuicBindingDropPacketEx(Binding, PktNum, Value, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_INFO, "[bind][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s, %u", Binding, PktNum, Reason, Value)
#define EventWriteQuicBindingError(Binding, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[bind][%p] ERROR, %s", Binding, ErrStr)
#define EventWriteQuicBindingErrorStatus(Binding, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[bind][%p] ERROR, %u, %s", Binding, Status, ErrStr)
#define EventWriteQuicBindingExecOper(Binding, OperType) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[bind][%p] Execute: %u", Binding, OperType)
#define EventWriteQuicTlsError(Connection, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ tls][%p] ERROR, %s", Connection, ErrStr)
#define EventWriteQuicTlsErrorStatus(Connection, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ tls][%p] ERROR, %u, %s", Connection, Status, ErrStr)
#define EventWriteQuicTlsMessage(Connection, Message) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ tls][%p] %s", Connection, Message)
#define EventWriteQuicDatapathSendTo(Binding, TotalSize, BufferCount, SegmentSize, RemoteAddrLen, RemoteAddr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Send %u bytes in %u buffers (segment=%u) Dst=TODO", Binding, TotalSize, BufferCount, SegmentSize)
#define EventWriteQuicDatapathSendFromTo(Binding, TotalSize, BufferCount, SegmentSize, RemoteAddrLen, LocalAddrLen, RemoteAddr, LocalAddr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Send %u bytes in %u buffers (segment=%u) Src=TODO Dst=TODO", Binding, TotalSize, BufferCount, SegmentSize)
#define EventWriteQuicDatapathRecv(Binding, TotalSize, SegmentSize, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Recv %u bytes (segment=%u) Src=TODO Dst=TODO", Binding, TotalSize, SegmentSize)
#define EventWriteQuicDatapathError(Binding, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ udp][%p] ERROR, %s", Binding, ErrStr)
#define EventWriteQuicDatapathErrorStatus(Binding, Status, ErrStr) \
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ udp][%p] ERROR, %u, %s", Binding, Status, ErrStr)
#define LOG_ADDR_LEN(Addr) sizeof(Addr)
#endif // defined(QUIC_EVENTS_STUB) || defined(QUIC_EVENTS_SYSLOG)
#endif // QUIC_EVENTS_STUB
#ifdef QUIC_EVENTS_MANIFEST_ETW
@ -425,27 +172,293 @@ QuicEtwCallback(
#include "MsQuicEtw.h"
#define QuicTraceEventEnabled(Name) EventEnabledQuic##Name()
#define _QuicTraceEvent(Name, Args) EventWriteQuic##Name##Args
#define QuicTraceEvent(Name, ...) _QuicTraceEvent(Name, (__VA_ARGS__))
#define LOG_ADDR_LEN(Addr) \
(uint8_t)((Addr).si_family == AF_INET6 ? sizeof(SOCKADDR_IN6) : sizeof(SOCKADDR_IN))
#endif // QUIC_EVENTS_MANIFEST_ETW
#ifdef QUIC_EVENTS_SYSLOG
#define QuicTraceEventEnabled(Name) TRUE
#define QuicTraceEvent(Name, ...) EventWriteQuic##Name(__VA_ARGS__)
#define EventWriteQuicLibraryInitialized(PartitionCount, DatapathFeatures) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ lib] Initialized, PartitionCount=%u DatapathFeatures=%u", PartitionCount, DatapathFeatures)
#define EventWriteQuicLibraryUninitialized() \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ lib] Uninitialized")
#define EventWriteQuicLibraryAddRef() \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ lib] AddRef")
#define EventWriteQuicLibraryRelease() \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ lib] Release")
#define EventWriteQuicLibraryWorkerPoolInit() \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ lib] Shared worker pool initializing")
#define EventWriteQuicAllocFailure(Desc, ByteCount) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_WARNING, "Allocation of '%s' failed. (%llu bytes)", Desc, ByteCount)
#define EventWriteQuicLibraryRundown(PartitionCount, DatapathFeatures) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ lib] Rundown, PartitionCount=%u DatapathFeatures=%u", PartitionCount, DatapathFeatures)
#define EventWriteQuicLibraryError(ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ lib] ERROR, %s.", ErrStr)
#define EventWriteQuicLibraryErrorStatus(Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ lib] ERROR, 0x%x, %s.", Status, ErrStr)
#define EventWriteQuicLibraryAssert(Line, File, Expression) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ lib] ASSERT, %s:%u - %s.", File, Line, Expression)
#define EventWriteQuicApiEnter(Type, Handle) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Enter %u (%p).", Type, Handle)
#define EventWriteQuicApiExit() \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Exit")
#define EventWriteQuicApiExitStatus(Status) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Exit 0x%x", Status)
#define EventWriteQuicApiWaitOperation() \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ api] Waiting on operation")
#define EventWriteQuicRegistrationCreated(Registration, AppName) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Created, AppName=%s", Registration, AppName)
#define EventWriteQuicRegistrationDestroyed(Registration) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Destroyed", Registration)
#define EventWriteQuicRegistrationCleanup(Registration) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Cleanup", Registration)
#define EventWriteQuicRegistrationRundown(Registration, AppName) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[ reg][%p] Rundown, AppName=%s", Registration, AppName)
#define EventWriteQuicRegistrationError(Registration, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ reg][%p] ERROR, %s", Registration, ErrStr)
#define EventWriteQuicRegistrationErrorStatus(Registration, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ reg][%p] ERROR, %u, %s", Registration, Status, ErrStr)
#define EventWriteQuicWorkerCreated(Worker, IdealProcessor, Owner) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Created, IdealProc=%u Owner=%p", Worker, IdealProcessor, Owner)
#define EventWriteQuicWorkerStart(Worker) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Start", Worker)
#define EventWriteQuicWorkerStop(Worker) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Stop", Worker)
#define EventWriteQuicWorkerActivityStateUpdated(Worker, IsActive, Arg) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[wrkr][%p] IsActive = %u, Arg = %u", IsActive, Arg)
#define EventWriteQuicWorkerQueueDelayUpdated(Worker, QueueDelay) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[wrkr][%p] QueueDelay: %u us", Worker, QueueDelay)
#define EventWriteQuicWorkerDestroyed(Worker) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Destroyed", Worker)
#define EventWriteQuicWorkerCleanup(Worker) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[wrkr][%p] Cleanup", Worker)
#define EventWriteQuicWorkerError(Worker, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[wrkr][%p] ERROR, %s", Worker, ErrStr)
#define EventWriteQuicWorkerErrorStatus(Worker, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[wrkr][%p] ERROR, %u, %s", Worker, Status, ErrStr)
#define EventWriteQuicSessionCreated(Session, Registration, Alpn) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Created, Registration=%p, ALPN='%s'", Session, Registration, Alpn)
#define EventWriteQuicSessionDestroyed(Session) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Destroyed", Session)
#define EventWriteQuicSessionCleanup(Session) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Cleanup", Session)
#define EventWriteQuicSessionShutdown(Session, Flags, ErrorCode) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Shutdown, Flags=0x%x, ErrorCode=%llu", Session, Flags, ErrorCode)
#define EventWriteQuicSessionRundown(Session, Registration, Alpn) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[sess][%p] Rundown, Registration=%p, ALPN='%s'", Session, Registration, Alpn)
#define EventWriteQuicSessionError(Session, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[sess][%p] ERROR, %s", Session, ErrStr)
#define EventWriteQuicSessionErrorStatus(Session, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[sess][%p] ERROR, %u, %s", Session, Status, ErrStr)
#define EventWriteQuicListenerCreated(Listener, Session) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[list][%p] Created, Session=%p", Listener, Session)
#define EventWriteQuicListenerDestroyed(Listener) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[list][%p] Destroyed", Listener)
#define EventWriteQuicListenerStarted(Listener, Binding, AddrLen, Addr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[list][%p] Started, Binding=%p, Addr=TODO", Listener, Binding)
#define EventWriteQuicListenerStopped(Listener) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[list][%p] Stopped", Listener)
#define EventWriteQuicListenerRundown(Listener, Session) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[list][%p] Rundown, Session=%p", Listener, Session)
#define EventWriteQuicListenerError(Listener, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[list][%p] ERROR, %s", Listener, ErrStr)
#define EventWriteQuicListenerErrorStatus(Listener, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[list][%p] ERROR, %u, %s", Listener, Status, ErrStr)
#define EventWriteQuicConnCreated(Connection, IsServer, CorrelationId) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Created, Server=%u, CorrelationId=%llu", Connection, IsServer, CorrelationId)
#define EventWriteQuicConnDestroyed(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Destroyed", Connection)
#define EventWriteQuicConnHandshakeComplete(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Handshake complete", Connection)
#define EventWriteQuicConnScheduleState(Connection, State) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Scheduling: %u", Connection, State)
#define EventWriteQuicConnExecOper(Connection, Type) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Execute: %u", Connection, Type)
#define EventWriteQuicConnExecApiOper(Connection, Type) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Execute: API %u", Connection, Type)
#define EventWriteQuicConnExecTimerOper(Connection, Type) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Execute: Timer %u", Connection, Type)
#define EventWriteQuicConnLocalAddrAdded(Connection, AddrLen, Addr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Local IP: TODO", Connection)
#define EventWriteQuicConnRemoteAddrAdded(Connection, AddrLen, Addr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Remote IP: TODO", Connection)
#define EventWriteQuicConnLocalAddrRemoved(Connection, AddrLen, Addr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Local IP: TODO", Connection)
#define EventWriteQuicConnRemoteAddrRemoved(Connection, AddrLen, Addr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Remote IP: TODO", Connection)
#define EventWriteQuicConnAssignWorker(Connection, Worker) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Assigned worker %p", Connection, Worker)
#define EventWriteQuicConnHandshakeStart(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Handshake start", Connection)
#define EventWriteQuicConnRegisterSession(Connection, Session) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Registered with session: %p", Connection, Session)
#define EventWriteQuicConnUnregisterSession(Connection, Session) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Unregistered from session: %p", Connection, Session)
#define EventWriteQuicConnTransportShutdown(Connection, ErrorCode, IsRemoteShutdown, IsQuicStatus) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Transport Shutdown: 0x%x (Remote=%u) (QS=%u)", Connection, ErrorCode, IsRemoteShutdown, IsQuicStatus)
#define EventWriteQuicConnAppShutdown(Connection, ErrorCode, IsRemoteShutdown) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] App Shutdown: 0x%x (Remote=%u)", ErrorCode, IsRemoteShutdown)
#define EventWriteQuicConnInitializeComplete(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Initialize complete", Connection)
#define EventWriteQuicConnHandleClosed(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Handle closed", Connection)
#define EventWriteQuicConnVersionSet(Connection, Value) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Version: 0x%x", Connection, Value)
#define EventWriteQuicConnOutFlowStats(Connection, BytesSent, BytesInFlight, BytesInFlightMax, CongestionWindow, SlowStartThreshold, ConnectionFlowControl, StreamFlowControl, IdealBytes, PostedBytes, SmoothedRtt, StreamSendWindow) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] OUT: BytesSent=%llu InFlight=%u InFlightMax=%u CWnd=%u SSThresh=%u ConnFC=%llu StreamFC=%llu ISB=%llu PostedBytes=%llu SRtt=%u StreamSndWnd=%llu", Connection, \
BytesSent, BytesInFlight, BytesInFlightMax, CongestionWindow, SlowStartThreshold, ConnectionFlowControl, StreamFlowControl, IdealBytes, PostedBytes, SmoothedRtt, StreamSendWindow)
#define EventWriteQuicConnOutFlowBlocked(Connection, ReasonFlags) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Send Blocked: 0x%x", Connection, ReasonFlags)
#define EventEnabledQuicConnOutFlowStats() TRUE
#define EventWriteQuicConnInFlowStats(Connection, BytesReceived) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] IN: BytesRecv=%llu", Connection, BytesReceived)
#define EventWriteQuicConnCubic(Connection, SlowStartThreshold, K, WindowMax, WindowLastMax) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] CUBIC: SlowStartThreshold=%u K=%u WindowMax=%u WindowLastMax=%u", Connection, SlowStartThreshold, K, WindowMax, WindowLastMax)
#define EventWriteQuicConnCongestion(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Congestion event", Connection)
#define EventWriteQuicConnPersistentCongestion(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Persistent congestion event", Connection)
#define EventWriteQuicConnRecoveryExit(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Recovery exit", Connection)
#define EventWriteQuicConnRundown(Connection, IsServer, CorrelationId) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Rundown, Server=%u, CorrelationId=%llu", Connection, IsServer, CorrelationId)
#define EventWriteQuicConnSourceCidAdded(Connection, CidLen, Cid) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Source CID: TODO", Connection)
#define EventWriteQuicConnDestCidAdded(Connection, CidLen, Cid) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New Destination CID: TODO", Connection)
#define EventWriteQuicConnSourceCidRemoved(Connection, CidLen, Cid) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Source CID: TODO", Connection)
#define EventWriteQuicConnDestCidRemoved(Connection, CidLen, Cid) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Removed Destination CID: TODO", Connection)
#define EventWriteQuicConnLossDetectionTimerSet(Connection, TimerType, DelayMs, ProbeCount) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Setting loss detection timer (type %u) for %u ms. (ProbeCount=%hu)", TimerType, DelayMs, ProbeCount)
#define EventWriteQuicConnLossDetectionTimerCancel(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Cancelling loss detection timer.", Connection)
#define EventWriteQuicConnDropPacket(Connection, PktNum, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s", Connection, PktNum, Reason)
#define EventWriteQuicConnDropPacketEx(Connection, PktNum, Value, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s, %u", Connection, PktNum, Reason, Value)
#define EventWriteQuicConnError(Connection, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[conn][%p] ERROR, %s", Connection, ErrStr)
#define EventWriteQuicConnErrorStatus(Connection, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[conn][%p] ERROR, %u, %s", Connection, Status, ErrStr)
#define EventWriteQuicConnNewPacketKeys(Connection) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] New packet keys generated", Connection)
#define EventWriteQuicConnKeyPhaseChange(Connection, IsLocallyInitiated) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Key phase change, IsLocallyInitiated=%u", Connection, IsLocallyInitiated)
#define EventWriteQuicConnStatistics(Connection, LifeTimeUs, SendTotalPackets, SendSuspectedLostPackets, SendSpuriousLostPackets, RecvTotalPackets, RecvReorderedPackets, RecvDroppedPackets, RecvDuplicatePackets, RecvDecryptionFailures, CongestionCount, PersistentCongestionCount, SendTotalBytes, RecvTotalBytes, SmoothedRtt) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] STATS: LifeTimeUs=%llu SendTotalPackets=%llu SendSuspectedLostPackets=%llu SendSpuriousLostPackets=%llu RecvTotalPackets=%llu RecvReorderedPackets=%llu RecvDroppedPackets=%llu RecvDuplicatePackets=%llu RecvDecryptionFailures=%llu CongestionCount=%u PersistentCongestionCount=%u SendTotalBytes=%llu RecvTotalBytes=%llu SmoothedRtt=%u", \
Connection, LifeTimeUs, SendTotalPackets, SendSuspectedLostPackets, SendSpuriousLostPackets, RecvTotalPackets, RecvReorderedPackets, RecvDroppedPackets, RecvDuplicatePackets, RecvDecryptionFailures, CongestionCount, PersistentCongestionCount, SendTotalBytes, RecvTotalBytes, SmoothedRtt)
#define EventWriteQuicConnShutdownComplete(Connection, TimedOut) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] Shutdown Complete, PeerFailedToAcknowledged=%u", Connection, TimedOut)
#define EventWriteQuicConnReadKeyUpdated(Connection, NewValue) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Read Key Updated, %u", Connection, NewValue)
#define EventWriteQuicConnWriteKeyUpdated(Connection, NewValue) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] Write Key Updated, %u", Connection, NewValue)
#define EventWriteQuicConnPacketSent(Connection, Number, Type, Length) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [TX][%llu] %u (%hu bytes)", Connection, Number, Type, Length)
#define EventWriteQuicConnPacketRecv(Connection, Number, Type, Length) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [RX][%llu] %u (%hu bytes)", Connection, Number, Type, Length)
#define EventWriteQuicConnPacketLost(Connection, Number, Type, Reason) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [TX][%llu] %u Lost: %u", Connection, Number, Type, Reason)
#define EventWriteQuicConnPacketACKed(Connection, Number, Type) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] [TX][%llu] %u ACKed", Connection, Number, Type)
#define EventWriteQuicStreamCreated(Stream, Connection, ID, IsLocalOwned) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Created, Connection=%p ID=%llu IsLocal=%hu", Stream, Connection, ID, IsLocalOwned)
#define EventWriteQuicStreamDestroyed(Stream) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Destroyed", Stream)
#define EventWriteQuicStreamOutFlowBlocked(Stream, ReasonFlags) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Send Blocked: 0x%x", Stream, ReasonFlags)
#define EventWriteQuicStreamRundown(Stream, Connection, ID, IsLocalOwned) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Rundown, Connection=%p ID=%llu IsLocal=%hu", Stream, Connection, ID, IsLocalOwned)
#define EventWriteQuicStreamSendState(Stream, State) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Send State: %u", Stream, State)
#define EventWriteQuicStreamRecvState(Stream, State) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[strm][%p] Recv State: %u", Stream, State)
#define EventWriteQuicStreamError(Stream, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[strm][%p] ERROR, %s", Stream, ErrStr)
#define EventWriteQuicStreamErrorStatus(Stream, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[strm][%p] ERROR, %u, %s", Stream, Status, ErrStr)
#define EventWriteQuicBindingCreated(Binding, UdpBinding, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Created %p, Udp=%llX LocalAddr=TODO RemoteAddr=TODO", Binding, UdpBinding);\
UNREFERENCED_PARAMETER(RemoteAddr); UNREFERENCED_PARAMETER(LocalAddr)
#define EventWriteQuicBindingRundown(Binding, UdpBinding, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Rundown %p, Udp=%llX LocalAddr=TODO RemoteAddr=TODO", Binding, UdpBinding);\
UNREFERENCED_PARAMETER(RemoteAddr); UNREFERENCED_PARAMETER(LocalAddr)
#define EventWriteQuicBindingDestroyed(Binding) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Destroyed", Binding)
#define EventWriteQuicBindingCleanup(Binding) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[bind][%p] Cleaning up", Binding)
#define EventWriteQuicBindingDropPacket(Binding, PktNum, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[bind][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s", Binding, PktNum, Reason)
#define EventWriteQuicBindingDropPacketEx(Binding, PktNum, Value, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr, Reason) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[bind][%p] DROP packet Num=%llu Src=TODO Dst=TODO Reason=%s, %u", Binding, PktNum, Reason, Value)
#define EventWriteQuicBindingError(Binding, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[bind][%p] ERROR, %s", Binding, ErrStr)
#define EventWriteQuicBindingErrorStatus(Binding, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[bind][%p] ERROR, %u, %s", Binding, Status, ErrStr)
#define EventWriteQuicBindingExecOper(Binding, OperType) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[bind][%p] Execute: %u", Binding, OperType)
#define EventWriteQuicTlsError(Connection, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ tls][%p] ERROR, %s", Connection, ErrStr)
#define EventWriteQuicTlsErrorStatus(Connection, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ tls][%p] ERROR, %u, %s", Connection, Status, ErrStr)
#define EventWriteQuicTlsMessage(Connection, Message) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ tls][%p] %s", Connection, Message)
#define EventWriteQuicDatapathSendTo(Binding, TotalSize, BufferCount, SegmentSize, RemoteAddrLen, RemoteAddr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Send %u bytes in %u buffers (segment=%u) Dst=TODO", Binding, TotalSize, BufferCount, SegmentSize)
#define EventWriteQuicDatapathSendFromTo(Binding, TotalSize, BufferCount, SegmentSize, RemoteAddrLen, LocalAddrLen, RemoteAddr, LocalAddr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Send %u bytes in %u buffers (segment=%u) Src=TODO Dst=TODO", Binding, TotalSize, BufferCount, SegmentSize)
#define EventWriteQuicDatapathRecv(Binding, TotalSize, SegmentSize, LocalAddrLen, RemoteAddrLen, LocalAddr, RemoteAddr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Recv %u bytes (segment=%u) Src=TODO Dst=TODO", Binding, TotalSize, SegmentSize)
#define EventWriteQuicDatapathError(Binding, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ udp][%p] ERROR, %s", Binding, ErrStr)
#define EventWriteQuicDatapathErrorStatus(Binding, Status, ErrStr) \
QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[ udp][%p] ERROR, %u, %s", Binding, Status, ErrStr)
#define LOG_ADDR_LEN(Addr) sizeof(Addr)
#endif // QUIC_EVENTS_SYSLOG
#ifdef QUIC_EVENTS_LTTNG
#include "quic_trace_lttng.h"
#endif // QUIC_EVENTS_LTTNG
#ifdef QUIC_LOGS_STUB
#define LogErrorEnabled() FALSE
#define LogWarningEnabled() FALSE
#define LogInfoEnabled() FALSE
#define LogVerboseEnabled() FALSE
#define QuicTraceLogErrorEnabled() FALSE
#define QuicTraceLogWarningEnabled() FALSE
#define QuicTraceLogInfoEnabled() FALSE
#define QuicTraceLogVerboseEnabled() FALSE
#define LogError(...)
#define LogWarning(...)
#define LogInfo(...)
#define LogVerbose(...)
#define QuicTraceLogError(...)
#define QuicTraceLogWarning(...)
#define QuicTraceLogInfo(...)
#define QuicTraceLogVerbose(...)
#define LogConnError(...)
#define LogConnWarning(...)
#define LogConnInfo(...)
#define LogConnVerbose(...)
#define QuicTraceLogConnError(...)
#define QuicTraceLogConnWarning(...)
#define QuicTraceLogConnInfo(...)
#define QuicTraceLogConnVerbose(...)
#endif // QUIC_LOGS_STUB
@ -490,26 +503,26 @@ extern "C" {
#define WPP_LEVEL_FLAGS_NOOP_POINTER_LOGGER(LEVEL,FLAGS,NOOP,POINTER) \
WPP_LEVEL_FLAGS_LOGGER(LEVEL,FLAGS)
#define LogErrorEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_ERROR)
#define LogWarningEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_WARNING)
#define LogInfoEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_INFORMATION)
#define LogVerboseEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_VERBOSE)
#define QuicTraceLogErrorEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_ERROR)
#define QuicTraceLogWarningEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_WARNING)
#define QuicTraceLogInfoEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_INFORMATION)
#define QuicTraceLogVerboseEnabled() WPP_FLAGS_LEVEL_ENABLED(FLAG_DEFAULT, TRACE_LEVEL_VERBOSE)
// begin_wpp config
// FUNC LogError{LEVEL=TRACE_LEVEL_ERROR,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC LogWarning{LEVEL=TRACE_LEVEL_WARNING,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC LogInfo{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC LogVerbose{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC QuicTraceLogError{LEVEL=TRACE_LEVEL_ERROR,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC QuicTraceLogWarning{LEVEL=TRACE_LEVEL_WARNING,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC QuicTraceLogInfo{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=FLAG_DEFAULT}(MSG,...);
// FUNC QuicTraceLogVerbose{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=FLAG_DEFAULT}(MSG,...);
// USEPREFIX(LogConnError,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC LogConnError{LEVEL=TRACE_LEVEL_ERROR,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(LogConnWarning,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC LogConnWarning{LEVEL=TRACE_LEVEL_WARNING,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(LogConnInfo,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC LogConnInfo{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(LogConnVerbose,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC LogConnVerbose{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(QuicTraceLogConnError,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC QuicTraceLogConnError{LEVEL=TRACE_LEVEL_ERROR,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(QuicTraceLogConnWarning,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC QuicTraceLogConnWarning{LEVEL=TRACE_LEVEL_WARNING,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(QuicTraceLogConnInfo,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC QuicTraceLogConnInfo{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// USEPREFIX(QuicTraceLogConnVerbose,"%!STDPREFIX![conn][%p]%!SPACE!",POINTER);
// FUNC QuicTraceLogConnVerbose{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=FLAG_CONNECTION}(NOOP,POINTER,MSG,...);
// end_wpp
@ -546,10 +559,10 @@ log_hexbuf(const void* Buffer, UINT32 Length) {
#include "MsQuicEtw.h"
#include <stdio.h>
#define LogErrorEnabled() TRUE
#define LogWarningEnabled() TRUE
#define LogInfoEnabled() TRUE
#define LogVerboseEnabled() TRUE
#define QuicTraceLogErrorEnabled() TRUE
#define QuicTraceLogWarningEnabled() TRUE
#define QuicTraceLogInfoEnabled() TRUE
#define QuicTraceLogVerboseEnabled() TRUE
#define LogEtw(EventName, Fmt, ...) \
if (EventEnabledQuicLog##EventName()) { \
@ -565,34 +578,34 @@ log_hexbuf(const void* Buffer, UINT32 Length) {
EventWriteQuic##Type##Log##EventName##_AssumeEnabled(Ptr, EtwBuffer); \
}
#define LogError(Fmt, ...) LogEtw(Error, Fmt, ##__VA_ARGS__)
#define LogWarning(Fmt, ...) LogEtw(Warning, Fmt, ##__VA_ARGS__)
#define LogInfo(Fmt, ...) LogEtw(Info, Fmt, ##__VA_ARGS__)
#define LogVerbose(Fmt, ...) LogEtw(Verbose, Fmt, ##__VA_ARGS__)
#define QuicTraceLogError(Fmt, ...) LogEtw(Error, Fmt, ##__VA_ARGS__)
#define QuicTraceLogWarning(Fmt, ...) LogEtw(Warning, Fmt, ##__VA_ARGS__)
#define QuicTraceLogInfo(Fmt, ...) LogEtw(Info, Fmt, ##__VA_ARGS__)
#define QuicTraceLogVerbose(Fmt, ...) LogEtw(Verbose, Fmt, ##__VA_ARGS__)
#define LogConnError(Name, Ptr, Fmt, ...) LogEtwType(Conn, Error, Ptr, Fmt, ##__VA_ARGS__)
#define LogConnWarning(Name, Ptr, Fmt, ...) LogEtwType(Conn, Warning, Ptr, Fmt, ##__VA_ARGS__)
#define LogConnInfo(Name, Ptr, Fmt, ...) LogEtwType(Conn, Info, Ptr, Fmt, ##__VA_ARGS__)
#define LogConnVerbose(Name, Ptr, Fmt, ...) LogEtwType(Conn, Verbose, Ptr, Fmt, ##__VA_ARGS__)
#define QuicTraceLogConnError(Name, Ptr, Fmt, ...) LogEtwType(Conn, Error, Ptr, Fmt, ##__VA_ARGS__)
#define QuicTraceLogConnWarning(Name, Ptr, Fmt, ...) LogEtwType(Conn, Warning, Ptr, Fmt, ##__VA_ARGS__)
#define QuicTraceLogConnInfo(Name, Ptr, Fmt, ...) LogEtwType(Conn, Info, Ptr, Fmt, ##__VA_ARGS__)
#define QuicTraceLogConnVerbose(Name, Ptr, Fmt, ...) LogEtwType(Conn, Verbose, Ptr, Fmt, ##__VA_ARGS__)
#endif // QUIC_LOGS_MANIFEST_ETW
#ifdef QUIC_LOGS_SYSLOG
#define LogErrorEnabled() TRUE
#define LogWarningEnabled() TRUE
#define LogInfoEnabled() TRUE
#define LogVerboseEnabled() TRUE
#define QuicTraceLogErrorEnabled() TRUE
#define QuicTraceLogWarningEnabled() TRUE
#define QuicTraceLogInfoEnabled() TRUE
#define QuicTraceLogVerboseEnabled() TRUE
#define LogError(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, Fmt, ##__VA_ARGS__)
#define LogWarning(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_WARNING, Fmt, ##__VA_ARGS__)
#define LogInfo(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, Fmt, ##__VA_ARGS__)
#define LogVerbose(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, Fmt, ##__VA_ARGS__)
#define QuicTraceLogError(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, Fmt, ##__VA_ARGS__)
#define QuicTraceLogWarning(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_WARNING, Fmt, ##__VA_ARGS__)
#define QuicTraceLogInfo(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, Fmt, ##__VA_ARGS__)
#define QuicTraceLogVerbose(Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, Fmt, ##__VA_ARGS__)
#define LogConnError(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define LogConnWarning(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_WARNING, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define LogConnInfo(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define LogConnVerbose(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define QuicTraceLogConnError(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_ERROR, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define QuicTraceLogConnWarning(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_WARNING, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define QuicTraceLogConnInfo(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_INFO, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#define QuicTraceLogConnVerbose(Name, Ptr, Fmt, ...) QuicSysLogWrite(QUIC_TRACE_LEVEL_VERBOSE, "[conn][%p] " Fmt, Ptr, ##__VA_ARGS__)
#endif // QUIC_LOGS_SYSLOG

1094
inc/quic_trace_lttng.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -40,6 +40,8 @@ add_library(platform STATIC ${SOURCES})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_dependencies(platform MsQuicEtw)
else()
target_link_libraries(platform ${LTTNGUST_LIBRARIES})
endif()
if(QUIC_TLS STREQUAL "openssl")

Просмотреть файл

@ -286,11 +286,11 @@ QuicCertMatchHash(
CERT_HASH_PROP_ID,
CertHash,
&CertHashLength)) {
LogError("[cert] Get CERT_HASH_PROP_ID failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] Get CERT_HASH_PROP_ID failed, 0x%x.", GetLastError());
return FALSE;
}
if (CertHashLength != sizeof(CertHash)) {
LogError("[cert] CERT_HASH_PROP_ID incorrect size, %u.", CertHashLength);
QuicTraceLogError("[cert] CERT_HASH_PROP_ID incorrect size, %u.", CertHashLength);
return FALSE;
}
return memcmp(InputCertHash, CertHash, CertHashLength) == 0;
@ -462,7 +462,7 @@ QuicCertLookupHashStore(
CertHashStore->StoreName);
if (CertStore == NULL) {
Status = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CertOpenStore failed '%s', 0x%x.", CertHashStore->StoreName, Status);
QuicTraceLogError("[cert] CertOpenStore failed '%s', 0x%x.", CertHashStore->StoreName, Status);
goto Exit;
}
@ -593,7 +593,7 @@ QuicCertParseChain(
CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG,
0);
if (TempStore == NULL) {
LogError("[cert] CertOpenStore failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] CertOpenStore failed, 0x%x.", GetLastError());
goto Error;
}
@ -615,7 +615,7 @@ QuicCertParseChain(
CertLength,
CERT_STORE_ADD_USE_EXISTING,
&CertCtx)) {
LogError("[cert] CertAddEncodedCertificateToStore failed for cert #%u, 0x%x.",
QuicTraceLogError("[cert] CertAddEncodedCertificateToStore failed for cert #%u, 0x%x.",
CertNumber, GetLastError());
goto Error;
}
@ -631,11 +631,11 @@ QuicCertParseChain(
}
if (ChainBufferLength != 0) {
LogError("[cert] Not all bytes were processed.");
QuicTraceLogError("[cert] Not all bytes were processed.");
goto Error;
}
LogVerbose("[cert] Successfully parsed chain of %u certificate(s).", CertNumber);
QuicTraceLogVerbose("[cert] Successfully parsed chain of %u certificate(s).", CertNumber);
goto Exit;
@ -675,7 +675,7 @@ QuicCertFormat(
if (CertCtx == NULL) {
if (BufferLength < SIZEOF_CERT_CHAIN_LIST_LENGTH) {
LogError("[cert] Insufficient buffer to store the empty formatted chain.");
QuicTraceLogError("[cert] Insufficient buffer to store the empty formatted chain.");
return 0;
}
//
@ -702,7 +702,7 @@ QuicCertFormat(
0,
NULL,
&ChainContext)) {
LogError("[cert] CertGetCertificateChain failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] CertGetCertificateChain failed, 0x%x.", GetLastError());
return 0;
}
@ -712,7 +712,7 @@ QuicCertFormat(
PCERT_CHAIN_ELEMENT Element = SimpleChain->rgpElement[j];
PCCERT_CONTEXT EncodedCert = Element->pCertContext;
if (EncodedCert->cbCertEncoded + SIZEOF_CERT_CHAIN_LIST_LENGTH > BufferLength) {
LogError("[cert] Insufficient buffer to store the formatted chain.");
QuicTraceLogError("[cert] Insufficient buffer to store the formatted chain.");
CertFreeCertificateChain(ChainContext);
return 0;
}
@ -731,7 +731,7 @@ QuicCertFormat(
Exit:
LogVerbose("[cert] Successfully formatted chain of %u certificate(s).", CertNumber);
QuicTraceLogVerbose("[cert] Successfully formatted chain of %u certificate(s).", CertNumber);
return (size_t)(Offset - Buffer);
}
@ -769,19 +769,19 @@ QuicCertVerifyCertChainPolicy(
&PolicyPara,
&PolicyStatus)) {
Status = GetLastError();
LogError("[cert] CertVerifyCertificateChainPolicy failed, 0x%x.", Status);
QuicTraceLogError("[cert] CertVerifyCertificateChainPolicy failed, 0x%x.", Status);
goto Exit;
} else if (PolicyStatus.dwError != NO_ERROR) {
Status = PolicyStatus.dwError;
LogError("[cert] CertVerifyCertificateChainPolicy indicated a cert error, 0x%x.", Status);
QuicTraceLogError("[cert] CertVerifyCertificateChainPolicy indicated a cert error, 0x%x.", Status);
goto Exit;
}
Exit:
LogInfo("CertVerifyChain: %S 0x%x, result=0x%x", ServerName, IgnoreFlags, Status);
QuicTraceLogInfo("CertVerifyChain: %S 0x%x, result=0x%x", ServerName, IgnoreFlags, Status);
return Status;
}
@ -823,26 +823,26 @@ QuicCertValidateChain(
0,
NULL,
&ChainContext)) {
LogError("[cert] CertGetCertificateChain failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] CertGetCertificateChain failed, 0x%x.", GetLastError());
goto Exit;
}
if (Host != NULL) {
int ServerNameLength = MultiByteToWideChar(CP_UTF8, 0, Host, -1, NULL, 0);
if (ServerNameLength == 0) {
LogError("[cert] MultiByteToWideChar(1) failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] MultiByteToWideChar(1) failed, 0x%x.", GetLastError());
goto Exit;
}
ServerName = (LPWSTR)QUIC_ALLOC_PAGED(ServerNameLength * sizeof(WCHAR));
if (ServerName == NULL) {
LogWarning("[cert] Failed to alloc %u bytes for ServerName.", (uint32_t)(ServerNameLength * sizeof(WCHAR)));
QuicTraceLogWarning("[cert] Failed to alloc %u bytes for ServerName.", (uint32_t)(ServerNameLength * sizeof(WCHAR)));
goto Exit;
}
ServerNameLength = MultiByteToWideChar(CP_UTF8, 0, Host, -1, ServerName, ServerNameLength);
if (ServerNameLength == 0) {
LogError("[cert] MultiByteToWideChar(2) failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] MultiByteToWideChar(2) failed, 0x%x.", GetLastError());
goto Exit;
}
}
@ -884,14 +884,14 @@ QuicCertGetPrivateKey(
&KeyProv,
&KeySpec,
&FreeKey)) {
LogError("[cert] CryptAcquireCertificatePrivateKey failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] CryptAcquireCertificatePrivateKey failed, 0x%x.", GetLastError());
goto Exit;
}
QUIC_DBG_ASSERT(FreeKey);
if (KeySpec != CERT_NCRYPT_KEY_SPEC) {
LogError("[cert] Cert KeySpec doesn't have CERT_NCRYPT_KEY_SPEC, 0x%x.", KeySpec);
QuicTraceLogError("[cert] Cert KeySpec doesn't have CERT_NCRYPT_KEY_SPEC, 0x%x.", KeySpec);
NCryptFreeObject(KeyProv);
KeyProv = (ULONG_PTR)NULL;
goto Exit;
@ -926,29 +926,29 @@ QuicCertSign(
{
NCRYPT_KEY_HANDLE KeyProv = (NCRYPT_KEY_HANDLE)PrivateKey;
LogVerbose("[cert] QuicCertSign alg=0x%4.4x", SignatureAlgorithm);
QuicTraceLogVerbose("[cert] QuicCertSign alg=0x%4.4x", SignatureAlgorithm);
_Null_terminated_ const wchar_t * HashAlg = HashAlgFromTLS(SignatureAlgorithm);
if (HashAlg == NULL) {
LogError("[cert] Unsupported hash algorithm 0x%x (HashAlg).", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported hash algorithm 0x%x (HashAlg).", SignatureAlgorithm);
return FALSE;
}
BCRYPT_ALG_HANDLE HashProv = HashHandleFromTLS(SignatureAlgorithm);
if (HashProv == NULL) {
LogError("[cert] Unsupported hash algorithm 0x%x.", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported hash algorithm 0x%x.", SignatureAlgorithm);
return FALSE;
}
DWORD HashSize = HashSizeFromTLS(SignatureAlgorithm);
if (HashSize == 0 || HashSize > QUIC_CERTIFICATE_MAX_HASH_SIZE) {
LogError("[cert] Unsupported hash size 0x%x.", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported hash size 0x%x.", SignatureAlgorithm);
return FALSE;
}
DWORD PaddingScheme = PaddingTypeFromTLS(SignatureAlgorithm);
if (PaddingScheme == ~0u) {
LogError("[cert] Unsupported padding scheme 0x%x.", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported padding scheme 0x%x.", SignatureAlgorithm);
return FALSE;
}
@ -966,7 +966,7 @@ QuicCertSign(
HashBuf,
HashSize);
if (!NT_SUCCESS(Status)) {
LogError("[cert] BCryptHash failed, 0x%x.", Status);
QuicTraceLogError("[cert] BCryptHash failed, 0x%x.", Status);
goto Exit;
}
@ -994,7 +994,7 @@ QuicCertSign(
&NewSignatureLength,
SignFlags);
if (!NT_SUCCESS(Status)) {
LogError("[cert] NCryptSignHash failed, 0x%x.", Status);
QuicTraceLogError("[cert] NCryptSignHash failed, 0x%x.", Status);
goto Exit;
}
@ -1024,34 +1024,34 @@ QuicCertVerify(
{
PCCERT_CONTEXT CertCtx = (PCCERT_CONTEXT)Certificate;
LogVerbose("[cert] QuicCertVerify alg=0x%4.4x", SignatureAlgorithm);
QuicTraceLogVerbose("[cert] QuicCertVerify alg=0x%4.4x", SignatureAlgorithm);
if (CertListToVerifyLength > MAXUINT32 || SignatureLength > MAXUINT32) {
LogError("[cert] CertListToVerify or Signature too large.");
QuicTraceLogError("[cert] CertListToVerify or Signature too large.");
return FALSE;
}
_Null_terminated_ const wchar_t * HashAlg = HashAlgFromTLS(SignatureAlgorithm);
if (HashAlg == NULL) {
LogError("[cert] Unsupported signature algorithm 0x%x (HashAlg).", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported signature algorithm 0x%x (HashAlg).", SignatureAlgorithm);
return FALSE;
}
DWORD PaddingScheme = PaddingTypeFromTLS(SignatureAlgorithm);
if (PaddingScheme == ~0u) {
LogError("[cert] Unsupported padding scheme 0x%x.", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported padding scheme 0x%x.", SignatureAlgorithm);
return FALSE;
}
BCRYPT_ALG_HANDLE HashProv = HashHandleFromTLS(SignatureAlgorithm);
if (HashProv == NULL) {
LogError("[cert] Unsupported hash algorithm 0x%x.", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported hash algorithm 0x%x.", SignatureAlgorithm);
return FALSE;
}
DWORD HashSize = HashSizeFromTLS(SignatureAlgorithm);
if (HashSize == 0 || HashSize > QUIC_CERTIFICATE_MAX_HASH_SIZE) {
LogError("[cert] Unsupported hash size 0x%x.", SignatureAlgorithm);
QuicTraceLogError("[cert] Unsupported hash size 0x%x.", SignatureAlgorithm);
return FALSE;
}
@ -1070,7 +1070,7 @@ QuicCertVerify(
HashBuf,
HashSize);
if (!NT_SUCCESS(Status)) {
LogError("[cert] BCryptHash failed, 0x%x.", Status);
QuicTraceLogError("[cert] BCryptHash failed, 0x%x.", Status);
goto Exit;
}
@ -1080,7 +1080,7 @@ QuicCertVerify(
0,
NULL,
&PublicKey)) {
LogError("[cert] CryptImportPublicKeyInfoEx2 failed, 0x%x.", GetLastError());
QuicTraceLogError("[cert] CryptImportPublicKeyInfoEx2 failed, 0x%x.", GetLastError());
goto Exit;
}
@ -1107,7 +1107,7 @@ QuicCertVerify(
(ULONG)SignatureLength,
SignFlags);
if (!NT_SUCCESS(Status)) {
LogError("[cert] BCryptVerifySignature failed, 0x%x.", Status);
QuicTraceLogError("[cert] BCryptVerifySignature failed, 0x%x.", Status);
goto Exit;
}

Просмотреть файл

@ -61,7 +61,7 @@ LogGetProcAddressFailure(
_In_ DWORD Error
)
{
LogVerbose("[cert] GetProcAddress failed for %s, 0x%x", FuncName, Error);
QuicTraceLogVerbose("[cert] GetProcAddress failed for %s, 0x%x", FuncName, Error);
}
QUIC_STATUS
@ -82,7 +82,7 @@ QuicCertLibraryInitialize(
miPKI.Libmipki = LoadLibrary("libmipki.dll");
if (miPKI.Libmipki == NULL) {
Status = GetLastError();
LogVerbose("[cert] Failed to Load libmipki.dll, 0x%x", Status);
QuicTraceLogVerbose("[cert] Failed to Load libmipki.dll, 0x%x", Status);
goto Error;
}
@ -118,13 +118,13 @@ QuicCertLibraryInitialize(
if (!miPKI.State) {
Status = QUIC_STATUS_INVALID_STATE;
LogError("[cert] mipki_init failed: %d.", erridx);
QuicTraceLogError("[cert] mipki_init failed: %d.", erridx);
goto Error;
}
if (!miPKI.mipki_add_root_file_or_path(miPKI.State, "CAFile.pem")) {
Status = QUIC_STATUS_INVALID_STATE;
LogError("[cert] mipki_add_root_file_or_path failed.");
QuicTraceLogError("[cert] mipki_add_root_file_or_path failed.");
goto Error;
}

Просмотреть файл

@ -365,14 +365,14 @@ QuicProcessorContextInitialize(
EpollFd = epoll_create1(EPOLL_CLOEXEC);
if (EpollFd == INVALID_SOCKET_FD) {
Status = errno;
LogError("[ dal] epoll_create1(EPOLL_CLOEXEC) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] epoll_create1(EPOLL_CLOEXEC) failed, 0x%x.", Status);
goto Exit;
}
EventFd = eventfd(0, EFD_CLOEXEC);
if (EventFd == INVALID_SOCKET_FD) {
Status = errno;
LogError("[ dal] eventfd failed, 0x%x.", Status);
QuicTraceLogError("[ dal] eventfd failed, 0x%x.", Status);
goto Exit;
}
@ -386,7 +386,7 @@ QuicProcessorContextInitialize(
Ret = epoll_ctl(EpollFd, EPOLL_CTL_ADD, EventFd, &EvtFdEpEvt);
if (Ret != 0) {
Status = errno;
LogError("[ dal] epoll_ctl(EPOLL_CTL_ADD) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] epoll_ctl(EPOLL_CTL_ADD) failed, 0x%x.", Status);
goto Exit;
}
@ -412,7 +412,7 @@ QuicProcessorContextInitialize(
Status = QuicThreadCreate(&ThreadConfig, &ProcContext->EpollWaitThread);
if (QUIC_FAILED(Status)) {
LogError("[ dal] QuicThreadCreate failed, 0x%x.", Status);
QuicTraceLogError("[ dal] QuicThreadCreate failed, 0x%x.", Status);
goto Exit;
}
@ -485,7 +485,7 @@ QuicDataPathInitialize(
QUIC_DATAPATH* Datapath = (QUIC_DATAPATH*)QUIC_ALLOC_PAGED(DatapathLength);
if (Datapath == NULL) {
LogError("[ dal] Datapath allocation failure.");
QuicTraceLogError("[ dal] Datapath allocation failure.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -596,7 +596,7 @@ QuicDataPathAllocRecvBlock(
QUIC_DATAPATH_RECV_BLOCK* RecvBlock =
QuicPoolAlloc(&Datapath->ProcContexts[ProcIndex].RecvBlockPool);
if (RecvBlock == NULL) {
LogWarning("[ dal] RecvBlock allocation failed.");
QuicTraceLogWarning("[ dal] RecvBlock allocation failed.");
} else {
QuicZeroMemory(RecvBlock, sizeof(*RecvBlock));
RecvBlock->OwningPool = &Datapath->ProcContexts[ProcIndex].RecvBlockPool;
@ -697,7 +697,7 @@ QuicDataPathResolveAddress(
goto Exit;
}
LogError("[%p] Couldn't resolve hostname '%s' to an IP address", Datapath, HostName);
QuicTraceLogError("[%p] Couldn't resolve hostname '%s' to an IP address", Datapath, HostName);
Status = QUIC_STATUS_DNS_RESOLUTION_ERROR;
Exit:
@ -735,7 +735,7 @@ QuicSocketContextInitialize(
SocketContext->CleanupFd = eventfd(0, EFD_CLOEXEC);
if (SocketContext->CleanupFd == INVALID_SOCKET_FD) {
Status = errno;
LogError("[ dal] eventfd failed, 0x%x.", Status);
QuicTraceLogError("[ dal] eventfd failed, 0x%x.", Status);
goto Exit;
}
@ -752,7 +752,7 @@ QuicSocketContextInitialize(
SocketContext->CleanupFd,
&EvtFdEpEvt) != 0) {
Status = errno;
LogError("[ dal] epoll_ctl(EPOLL_CTL_ADD) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] epoll_ctl(EPOLL_CTL_ADD) failed, 0x%x.", Status);
goto Exit;
}
@ -766,7 +766,7 @@ QuicSocketContextInitialize(
IPPROTO_UDP);
if (SocketContext->SocketFd == INVALID_SOCKET_FD) {
Status = errno;
LogError("[ dal] socket failed, 0x%x.", Status);
QuicTraceLogError("[ dal] socket failed, 0x%x.", Status);
goto Exit;
}
@ -783,7 +783,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(IPV6_V6ONLY) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(IPV6_V6ONLY) failed, 0x%x.", Status);
goto Exit;
}
@ -807,7 +807,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(IP_MTU_DISCOVER) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(IP_MTU_DISCOVER) failed, 0x%x.", Status);
goto Exit;
}
@ -821,7 +821,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(IPV6_DONTFRAG) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(IPV6_DONTFRAG) failed, 0x%x.", Status);
goto Exit;
}
@ -845,7 +845,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(IPV6_RECVPKTINFO) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(IPV6_RECVPKTINFO) failed, 0x%x.", Status);
goto Exit;
}
@ -859,7 +859,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(IP_PKTINFO) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(IP_PKTINFO) failed, 0x%x.", Status);
goto Exit;
}
@ -877,7 +877,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(SO_RCVBUF) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(SO_RCVBUF) failed, 0x%x.", Status);
goto Exit;
}
@ -894,7 +894,7 @@ QuicSocketContextInitialize(
sizeof(Option));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] setsockopt(SO_REUSEADDR) failed, 0x%x.", Status);
QuicTraceLogError("[ dal] setsockopt(SO_REUSEADDR) failed, 0x%x.", Status);
goto Exit;
}
@ -905,7 +905,7 @@ QuicSocketContextInitialize(
sizeof(Binding->LocalAddress));
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] bind failed, 0x%x.", Status);
QuicTraceLogError("[ dal] bind failed, 0x%x.", Status);
goto Exit;
}
@ -921,7 +921,7 @@ QuicSocketContextInitialize(
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] connect failed, 0x%x.", Status);
QuicTraceLogError("[ dal] connect failed, 0x%x.", Status);
goto Exit;
}
@ -943,7 +943,7 @@ QuicSocketContextInitialize(
&AssignedLocalAddressLength);
if (Result == SOCKET_ERROR) {
Status = errno;
LogError("[ dal] getsockname failed, 0x%x.", Status);
QuicTraceLogError("[ dal] getsockname failed, 0x%x.", Status);
goto Exit;
}
@ -951,7 +951,7 @@ QuicSocketContextInitialize(
QUIC_DBG_ASSERT(LocalAddress->Ipv4.sin_port == Binding->LocalAddress.Ipv4.sin_port);
}
//LogVerbose("[sock][%p] Initialized", SocketContext);
//QuicTraceLogVerbose("[sock][%p] Initialized", SocketContext);
Exit:
@ -969,7 +969,7 @@ QuicSocketContextUninitialize(
_In_ QUIC_DATAPATH_PROC_CONTEXT* ProcContext
)
{
//LogVerbose("[sock][%p] Uninitialize", SocketContext);
//QuicTraceLogVerbose("[sock][%p] Uninitialize", SocketContext);
epoll_ctl(ProcContext->EpollFd, EPOLL_CTL_DEL, SocketContext->SocketFd, NULL);
const eventfd_t Value = 1;
@ -982,7 +982,7 @@ QuicSocketContextUninitializeComplete(
_In_ QUIC_DATAPATH_PROC_CONTEXT* ProcContext
)
{
//LogVerbose("[sock][%p] Uninitialize complete.", SocketContext);
//QuicTraceLogVerbose("[sock][%p] Uninitialize complete.", SocketContext);
if (SocketContext->CurrentRecvBlock != NULL) {
QuicDataPathBindingReturnRecvDatagrams(&SocketContext->CurrentRecvBlock->RecvPacket);
@ -1015,7 +1015,7 @@ QuicSocketContextPrepareReceive(
SocketContext->Binding->Datapath,
QuicProcCurrentNumber());
if (SocketContext->CurrentRecvBlock == NULL) {
LogWarning("[sock][%p] QuicDataPathAllocRecvBlock failed.", SocketContext);
QuicTraceLogWarning("[sock][%p] QuicDataPathAllocRecvBlock failed.", SocketContext);
return QUIC_STATUS_OUT_OF_MEMORY;
}
}
@ -1056,7 +1056,7 @@ QuicSocketContextStartReceive(
}
};
//LogVerbose("[sock][%p] epoll ADD: IN | ET", SocketContext);
//QuicTraceLogVerbose("[sock][%p] epoll ADD: IN | ET", SocketContext);
int Ret =
epoll_ctl(
@ -1066,7 +1066,7 @@ QuicSocketContextStartReceive(
&SockFdEpEvt);
if (Ret != 0) {
Status = Ret;
LogError("[sock][%p] epoll_ctl failed, 0x%x.", SocketContext, Status);
QuicTraceLogError("[sock][%p] epoll_ctl failed, 0x%x.", SocketContext, Status);
goto Error;
}
@ -1132,7 +1132,7 @@ QuicSocketContextRecvComplete(
char LocalInet6AddrStr[INET6_ADDRSTRLEN] = {0};
char RemoteInet6AddrStr[INET6_ADDRSTRLEN] = {0};
if (RemoteAddr->si_family == AF_INET) {
LogVerbose("[sock][%p] Received [%zd] (buflen=[%" PRIu16 "]) bytes Src=[%s:%" PRIu16 "] Dst=[%s:%" PRIu16 "], bind=[%p].",
QuicTraceLogVerbose("[sock][%p] Received [%zd] (buflen=[%" PRIu16 "]) bytes Src=[%s:%" PRIu16 "] Dst=[%s:%" PRIu16 "], bind=[%p].",
SocketContext, BytesTransferred,
RecvPacket->BufferLength,
inet_ntop(AF_INET, &RemoteAddr->Ipv4.sin_addr, RemoteInet6AddrStr, INET_ADDRSTRLEN),
@ -1141,7 +1141,7 @@ QuicSocketContextRecvComplete(
ntohs(LocalAddr->Ipv4.sin_port),
SocketContext->Binding);
} else {
LogVerbose("[sock][%p] Received [%zd] (buflen=[%" PRIu16 "]) bytes Src=[%s:%" PRIu16 "] Dst=[%s:%" PRIu16 "%%%" PRIu32 "], bind=[%p].",
QuicTraceLogVerbose("[sock][%p] Received [%zd] (buflen=[%" PRIu16 "]) bytes Src=[%s:%" PRIu16 "] Dst=[%s:%" PRIu16 "%%%" PRIu32 "], bind=[%p].",
SocketContext, BytesTransferred,
RecvPacket->BufferLength,
inet_ntop(AF_INET6, &RemoteAddr->Ipv6.sin6_addr, RemoteInet6AddrStr, INET6_ADDRSTRLEN),
@ -1180,7 +1180,7 @@ QuicSocketContextPendSend(
_In_ const QUIC_ADDR* RemoteAddress
)
{
//LogVerbose("[sock][%p] Pending send.", SocketContext);
//QuicTraceLogVerbose("[sock][%p] Pending send.", SocketContext);
if (!SocketContext->SendWaiting) {
@ -1191,7 +1191,7 @@ QuicSocketContextPendSend(
}
};
//LogVerbose("[sock][%p] epoll MOD: IN | OUT | ET", SocketContext);
//QuicTraceLogVerbose("[sock][%p] epoll MOD: IN | OUT | ET", SocketContext);
int Ret =
epoll_ctl(
@ -1200,7 +1200,7 @@ QuicSocketContextPendSend(
SocketContext->SocketFd,
&SockFdEpEvt);
if (Ret != 0) {
LogError("[sock][%p] epoll_ctl failed, 0x%x.", SocketContext, errno);
QuicTraceLogError("[sock][%p] epoll_ctl failed, 0x%x.", SocketContext, errno);
return errno;
}
@ -1259,7 +1259,7 @@ QuicSocketContextSendComplete(
}
};
//LogVerbose("[sock][%p] epoll MOD: IN | ET", SocketContext);
//QuicTraceLogVerbose("[sock][%p] epoll MOD: IN | ET", SocketContext);
int Ret =
epoll_ctl(
@ -1269,7 +1269,7 @@ QuicSocketContextSendComplete(
&SockFdEpEvt);
if (Ret != 0) {
Status = Ret;
LogError("[sock][%p] epoll_ctl failed, 0x%x.", SocketContext, Status);
QuicTraceLogError("[sock][%p] epoll_ctl failed, 0x%x.", SocketContext, Status);
goto Exit;
}
@ -1325,7 +1325,7 @@ QuicSocketContextProcessEvents(
QUIC_DBG_ASSERT(EventType == QUIC_SOCK_EVENT_SOCKET);
//LogVerbose("[sock][%p] Process Events: 0x%x.", SocketContext, Events);
//QuicTraceLogVerbose("[sock][%p] Process Events: 0x%x.", SocketContext, Events);
if (EPOLLERR & Events) {
int ErrNum = 0;
@ -1338,9 +1338,9 @@ QuicSocketContextProcessEvents(
&ErrNum,
&OptLen);
if (Ret < 0) {
LogError("[sock][%p] getsockopt(SO_ERROR) failed, 0x%x.", SocketContext, errno);
QuicTraceLogError("[sock][%p] getsockopt(SO_ERROR) failed, 0x%x.", SocketContext, errno);
} else {
LogError("[sock][%p] Socket error event:, 0x%x (%s).", SocketContext, ErrNum, strerror(ErrNum));
QuicTraceLogError("[sock][%p] Socket error event:, 0x%x (%s).", SocketContext, ErrNum, strerror(ErrNum));
//
// Send unreachable notification to MsQuic if any related
@ -1368,7 +1368,7 @@ QuicSocketContextProcessEvents(
0);
if (Ret < 0) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
LogError("[sock][%p] recvmsg failed, 0x%x.", SocketContext, errno);
QuicTraceLogError("[sock][%p] recvmsg failed, 0x%x.", SocketContext, errno);
}
break;
} else {
@ -1415,11 +1415,11 @@ QuicDataPathBindingCreate(
(QUIC_DATAPATH_BINDING*)QUIC_ALLOC_PAGED(BindingLength);
if (Binding == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
LogError("[ dal] Binding allocation failed");
QuicTraceLogError("[ dal] Binding allocation failed");
goto Exit;
}
LogInfo("[bind][%p] Created.", Binding);
QuicTraceLogInfo("[bind][%p] Created.", Binding);
QuicZeroMemory(Binding, BindingLength);
Binding->Datapath = Datapath;
@ -1506,7 +1506,7 @@ QuicDataPathBindingDelete(
return PlatDispatch->DatapathBindingDelete(Binding);
#else
QUIC_DBG_ASSERT(Binding != NULL);
LogVerbose("[bind][%p] Binding shutting down", Binding);
QuicTraceLogVerbose("[bind][%p] Binding shutting down", Binding);
//
// The function is called by the upper layer when it is completely done
@ -1679,7 +1679,7 @@ QuicDataPathBindingAllocSendContext(
SendContext = QuicPoolAlloc(&ProcContext->SendContextPool);
if (SendContext == NULL) {
LogError("[ dal] QuicPoolAlloc failed.");
QuicTraceLogError("[ dal] QuicPoolAlloc failed.");
goto Exit;
}
@ -1732,7 +1732,7 @@ QuicDataPathBindingAllocSendDatagram(
if (SendContext->BufferCount ==
SendContext->Owner->Datapath->MaxSendBatchSize) {
LogError("[ dal] Max batch size limit hit.");
QuicTraceLogError("[ dal] Max batch size limit hit.");
goto Exit;
}
@ -1741,7 +1741,7 @@ QuicDataPathBindingAllocSendDatagram(
Buffer->Buffer = QuicPoolAlloc(&SendContext->Owner->SendBufferPool);
if (Buffer->Buffer == NULL) {
LogWarning("[ dal] Send buffer allocation failed.");
QuicTraceLogWarning("[ dal] Send buffer allocation failed.");
goto Exit;
}
@ -1826,7 +1826,7 @@ QuicDataPathBindingSend(
if (SentByteCount < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
LogVerbose("[ dal] sendto() blocked.");
QuicTraceLogVerbose("[ dal] sendto() blocked.");
Status =
QuicSocketContextPendSend(
@ -1847,7 +1847,7 @@ QuicDataPathBindingSend(
//
Status = errno;
LogError("[ dal] sendto failed, status: %u.", Status);
QuicTraceLogError("[ dal] sendto failed, status: %u.", Status);
goto Exit;
}
} else {
@ -1855,7 +1855,7 @@ QuicDataPathBindingSend(
// Completed synchronously.
//
LogVerbose("[sock][%p] Send (%p) completion succeeded, bytes transferred %d",
QuicTraceLogVerbose("[sock][%p] Send (%p) completion succeeded, bytes transferred %d",
SocketContext, SendContext, SentByteCount);
}
}
@ -1927,7 +1927,7 @@ QuicDataPathBindingSend(
goto Exit;
} else {
Status = errno;
LogError("[ dal] sendmsg failed, 0x%x.", Status);
QuicTraceLogError("[ dal] sendmsg failed, 0x%x.", Status);
goto Exit;
}
} else {
@ -1935,7 +1935,7 @@ QuicDataPathBindingSend(
// Completed synchronously.
//
LogVerbose("[sock][%p] Send (%p) completion succeeded, bytes transferred %d",
QuicTraceLogVerbose("[sock][%p] Send (%p) completion succeeded, bytes transferred %d",
SocketContext, SendContext, SentByteCount);
}
}
@ -1979,7 +1979,7 @@ QuicDataPathBindingSendTo(
for (size_t i = 0; i < SendContext->BufferCount; ++i) {
if (RemoteAddress->si_family == AF_INET) {
LogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Dst=[%s:%" PRIu16 "] (%p)",
QuicTraceLogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Dst=[%s:%" PRIu16 "] (%p)",
SocketContext,
SocketContext->SocketFd,
SendContext->Buffers[i].Length,
@ -1987,7 +1987,7 @@ QuicDataPathBindingSendTo(
ntohs(RemoteAddress->Ipv4.sin_port),
SendContext);
} else {
LogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Dst=[%s:%" PRIu16 "] (%p)",
QuicTraceLogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Dst=[%s:%" PRIu16 "] (%p)",
SocketContext,
SocketContext->SocketFd,
SendContext->Buffers[i].Length,
@ -2038,7 +2038,7 @@ QuicDataPathBindingSendFromTo(
for (size_t i = 0; i < SendContext->BufferCount; ++i) {
if (RemoteAddress->si_family == AF_INET) {
LogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Src=[%s:%" PRIu16 "%%%" PRIu32 "] Dst=[%s:%" PRIu16 "] (%p)",
QuicTraceLogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Src=[%s:%" PRIu16 "%%%" PRIu32 "] Dst=[%s:%" PRIu16 "] (%p)",
SocketContext,
SocketContext->SocketFd,
SendContext->Buffers[i].Length,
@ -2049,7 +2049,7 @@ QuicDataPathBindingSendFromTo(
ntohs(RemoteAddress->Ipv4.sin_port),
SendContext);
} else {
LogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Src=[%s:%" PRIu16 "%%%" PRIu32 "] Dst=[%s:%" PRIu16 "] (%p)",
QuicTraceLogVerbose("[sock][%p] SocketFd=[%d], sending %" PRIu32 " bytes Src=[%s:%" PRIu16 "%%%" PRIu32 "] Dst=[%s:%" PRIu16 "] (%p)",
SocketContext,
SocketContext->SocketFd,
SendContext->Buffers[i].Length,

Просмотреть файл

@ -430,7 +430,7 @@ QuicDataPathQueryRssScalabilityInfo(
SOCKET RssSocket = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
if (RssSocket == INVALID_SOCKET) {
int WsaError = WSAGetLastError();
LogWarning("[ dal] RSS helper socket failed to open, 0x%x", WsaError);
QuicTraceLogWarning("[ dal] RSS helper socket failed to open, 0x%x", WsaError);
goto Error;
}
@ -447,7 +447,7 @@ QuicDataPathQueryRssScalabilityInfo(
NULL);
if (Result != NO_ERROR) {
int WsaError = WSAGetLastError();
LogWarning("[ dal] Query for SIO_QUERY_RSS_SCALABILITY_INFO failed, 0x%x", WsaError);
QuicTraceLogWarning("[ dal] Query for SIO_QUERY_RSS_SCALABILITY_INFO failed, 0x%x", WsaError);
goto Error;
}
@ -474,7 +474,7 @@ QuicDataPathQuerySockoptSupport(
SOCKET UdpSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (UdpSocket == INVALID_SOCKET) {
int WsaError = WSAGetLastError();
LogWarning("[ dal] UDP send segmentation helper socket failed to open, 0x%x", WsaError);
QuicTraceLogWarning("[ dal] UDP send segmentation helper socket failed to open, 0x%x", WsaError);
goto Error;
}
@ -491,7 +491,7 @@ QuicDataPathQuerySockoptSupport(
&OptionLength);
if (Result != NO_ERROR) {
int WsaError = WSAGetLastError();
LogWarning("[ dal] Query for UDP_SEND_MSG_SIZE failed, 0x%x", WsaError);
QuicTraceLogWarning("[ dal] Query for UDP_SEND_MSG_SIZE failed, 0x%x", WsaError);
} else {
Datapath->Features |= QUIC_DATAPATH_FEATURE_SEND_SEGMENTATION;
}
@ -511,7 +511,7 @@ QuicDataPathQuerySockoptSupport(
&OptionLength);
if (Result != NO_ERROR) {
int WsaError = WSAGetLastError();
LogWarning("[ dal] Query for UDP_RECV_MAX_COALESCED_SIZE failed, 0x%x", WsaError);
QuicTraceLogWarning("[ dal] Query for UDP_RECV_MAX_COALESCED_SIZE failed, 0x%x", WsaError);
} else {
Datapath->Features |= QUIC_DATAPATH_FEATURE_RECV_COALESCING;
}
@ -547,7 +547,7 @@ QuicDataPathInitialize(
}
if ((WsaError = WSAStartup(MAKEWORD(2, 2), &WsaData)) != 0) {
EventWriteQuicLibraryErrorStatus(WsaError, "WSAStartup");
QuicTraceEvent(LibraryErrorStatus, WsaError, "WSAStartup");
Status = HRESULT_FROM_WIN32(WsaError);
Datapath = NULL;
goto Exit;
@ -565,7 +565,7 @@ QuicDataPathInitialize(
Datapath = (QUIC_DATAPATH*)QUIC_ALLOC_PAGED(DatapathLength);
if (Datapath == NULL) {
EventWriteQuicAllocFailure("QUIC_DATAPATH", DatapathLength);
QuicTraceEvent(AllocFailure, "QUIC_DATAPATH", DatapathLength);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -650,7 +650,7 @@ QuicDataPathInitialize(
1);
if (Datapath->ProcContexts[i].IOCP == NULL) {
DWORD LastError = GetLastError();
EventWriteQuicLibraryErrorStatus(LastError, "CreateIoCompletionPort");
QuicTraceEvent(LibraryErrorStatus, LastError, "CreateIoCompletionPort");
Status = HRESULT_FROM_WIN32(LastError);
goto Error;
}
@ -665,7 +665,7 @@ QuicDataPathInitialize(
NULL);
if (Datapath->ProcContexts[i].CompletionThread == NULL) {
DWORD LastError = GetLastError();
EventWriteQuicLibraryErrorStatus(LastError, "CreateThread");
QuicTraceEvent(LibraryErrorStatus, LastError, "CreateThread");
Status = HRESULT_FROM_WIN32(LastError);
goto Error;
}
@ -675,7 +675,7 @@ QuicDataPathInitialize(
Datapath->ProcContexts[i].CompletionThread,
AffinityMask) == 0) {
DWORD LastError = GetLastError();
EventWriteQuicLibraryErrorStatus(LastError, "SetThreadAffinityMask");
QuicTraceEvent(LibraryErrorStatus, LastError, "SetThreadAffinityMask");
Status = HRESULT_FROM_WIN32(LastError);
goto Error;
}
@ -689,7 +689,7 @@ QuicDataPathInitialize(
&ThreadNameInfo,
sizeof(ThreadNameInfo));
if (!NT_SUCCESS(NtStatus)) {
EventWriteQuicLibraryErrorStatus(NtStatus, "NtSetInformationThread(name)");
QuicTraceEvent(LibraryErrorStatus, NtStatus, "NtSetInformationThread(name)");
}
// TODO - Set thread priority higher to better match kernel at dispatch?
@ -853,7 +853,7 @@ QuicDataPathResolveAddress(
0);
if (Result == 0) {
DWORD LastError = GetLastError();
EventWriteQuicLibraryErrorStatus(LastError, "Calculate hostname wchar length");
QuicTraceEvent(LibraryErrorStatus, LastError, "Calculate hostname wchar length");
Status = HRESULT_FROM_WIN32(LastError);
goto Exit;
}
@ -861,7 +861,7 @@ QuicDataPathResolveAddress(
HostNameW = QUIC_ALLOC_PAGED(sizeof(WCHAR) * Result);
if (HostNameW == NULL) {
Status = QUIC_STATUS_OUT_OF_MEMORY;
EventWriteQuicAllocFailure("Wchar hostname", sizeof(WCHAR) * Result);
QuicTraceEvent(AllocFailure, "Wchar hostname", sizeof(WCHAR) * Result);
goto Exit;
}
@ -875,7 +875,7 @@ QuicDataPathResolveAddress(
Result);
if (Result == 0) {
DWORD LastError = GetLastError();
EventWriteQuicLibraryErrorStatus(LastError, "Convert hostname to wchar");
QuicTraceEvent(LibraryErrorStatus, LastError, "Convert hostname to wchar");
Status = HRESULT_FROM_WIN32(LastError);
goto Exit;
}
@ -907,8 +907,8 @@ QuicDataPathResolveAddress(
goto Exit;
}
EventWriteQuicLibraryError("Resolving hostname to IP");
LogError("[%p] Couldn't resolve hostname '%s' to an IP address", Datapath, HostName);
QuicTraceEvent(LibraryError, "Resolving hostname to IP");
QuicTraceLogError("[%p] Couldn't resolve hostname '%s' to an IP address", Datapath, HostName);
Status = HRESULT_FROM_WIN32(WSAHOST_NOT_FOUND);
Exit:
@ -949,7 +949,7 @@ QuicDataPathBindingCreate(
Binding = (QUIC_DATAPATH_BINDING*)QUIC_ALLOC_PAGED(BindingLength);
if (Binding == NULL) {
EventWriteQuicAllocFailure("QUIC_DATAPATH_BINDING", BindingLength);
QuicTraceEvent(AllocFailure, "QUIC_DATAPATH_BINDING", BindingLength);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -991,7 +991,7 @@ QuicDataPathBindingCreate(
WSA_FLAG_OVERLAPPED);
if (SocketContext->Socket == INVALID_SOCKET) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "WSASocketW");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "WSASocketW");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1015,7 +1015,7 @@ QuicDataPathBindingCreate(
NULL);
if (Result != NO_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "SIO_GET_EXTENSION_FUNCTION_POINTER (WSASendMsg)");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "SIO_GET_EXTENSION_FUNCTION_POINTER (WSASendMsg)");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1040,7 +1040,7 @@ QuicDataPathBindingCreate(
NULL);
if (Result != NO_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "SIO_GET_EXTENSION_FUNCTION_POINTER (WSARecvMsg)");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "SIO_GET_EXTENSION_FUNCTION_POINTER (WSARecvMsg)");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1071,7 +1071,7 @@ QuicDataPathBindingCreate(
NULL);
if (Result != NO_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "SIO_SET_PORT_SHARING_PER_PROC_SOCKET");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "SIO_SET_PORT_SHARING_PER_PROC_SOCKET");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1087,7 +1087,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set IPV6_V6ONLY");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set IPV6_V6ONLY");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1102,7 +1102,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set IP_DONTFRAGMENT");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set IP_DONTFRAGMENT");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1117,7 +1117,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set IPV6_DONTFRAG");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set IPV6_DONTFRAG");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1132,7 +1132,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set IPV6_PKTINFO");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set IPV6_PKTINFO");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1147,7 +1147,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set IP_PKTINFO");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set IP_PKTINFO");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1166,7 +1166,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set SO_RCVBUF");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set SO_RCVBUF");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1183,7 +1183,7 @@ QuicDataPathBindingCreate(
sizeof(Option));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "Set UDP_RECV_MAX_COALESCED_SIZE");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "Set UDP_RECV_MAX_COALESCED_SIZE");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1199,7 +1199,7 @@ QuicDataPathBindingCreate(
(HANDLE)SocketContext->Socket,
FILE_SKIP_COMPLETION_PORT_ON_SUCCESS | FILE_SKIP_SET_EVENT_ON_HANDLE)) {
DWORD LastError = GetLastError();
EventWriteQuicDatapathErrorStatus(Binding, LastError, "SetFileCompletionNotificationModes");
QuicTraceEvent(DatapathErrorStatus, Binding, LastError, "SetFileCompletionNotificationModes");
Status = HRESULT_FROM_WIN32(LastError);
goto Error;
}
@ -1213,7 +1213,7 @@ QUIC_DISABLED_BY_FUZZER_START;
sizeof(Binding->LocalAddress));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "bind");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "bind");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1233,7 +1233,7 @@ QUIC_DISABLED_BY_FUZZER_START;
sizeof(MappedRemoteAddress));
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "connect");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "connect");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1280,7 +1280,7 @@ QUIC_DISABLED_BY_FUZZER_END;
NULL);
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
LogWarning("[sock][%p] WSAIoctl for SIO_QUERY_RSS_PROCESSOR_INFO failed, 0x%x", SocketContext, WsaError);
QuicTraceLogWarning("[sock][%p] WSAIoctl for SIO_QUERY_RSS_PROCESSOR_INFO failed, 0x%x", SocketContext, WsaError);
} else {
AffinitizedProcessor =
(RssAffinity.Processor.Number % Datapath->ProcCount);
@ -1298,7 +1298,7 @@ QUIC_DISABLED_BY_FUZZER_END;
(ULONG_PTR)SocketContext,
0)) {
DWORD LastError = GetLastError();
EventWriteQuicDatapathErrorStatus(Binding, LastError, "CreateIoCompletionPort");
QuicTraceEvent(DatapathErrorStatus, Binding, LastError, "CreateIoCompletionPort");
Status = HRESULT_FROM_WIN32(LastError);
goto Error;
}
@ -1321,7 +1321,7 @@ QUIC_DISABLED_BY_FUZZER_START;
&AssignedLocalAddressLength);
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
EventWriteQuicDatapathErrorStatus(Binding, WsaError, "getsockaddress");
QuicTraceEvent(DatapathErrorStatus, Binding, WsaError, "getsockaddress");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1422,7 +1422,7 @@ QuicDataPathBindingDelete(
)
{
QUIC_DBG_ASSERT(Binding != NULL);
LogVerbose("[bind][%p] Binding shutting down", Binding);
QuicTraceLogVerbose("[bind][%p] Binding shutting down", Binding);
//
// The function is called by the upper layer when it is completely done
@ -1478,7 +1478,7 @@ QUIC_DISABLED_BY_FUZZER_END;
&SocketContext->RecvOverlapped);
}
}
LogVerbose("[bind][%p] Binding shutting down (return)", Binding);
QuicTraceLogVerbose("[bind][%p] Binding shutting down (return)", Binding);
}
void
@ -1501,7 +1501,7 @@ QuicDataPathSocketContextShutdown(
// Last socket context cleaned up, so now the binding can be freed.
//
QuicRundownRelease(&SocketContext->Binding->Datapath->BindingsRundown);
LogVerbose("[bind][%p] Binding shut down complete", SocketContext->Binding);
QuicTraceLogVerbose("[bind][%p] Binding shut down complete", SocketContext->Binding);
QUIC_FREE(SocketContext->Binding);
}
}
@ -1569,13 +1569,13 @@ QuicDataPathBindingHandleUnreachableError(
#ifdef QUIC_LOGS_WPP // TODO - Change to ETW event
if (RemoteAddr->si_family == AF_INET) {
LogVerbose("[sock][%p] Received unreachable error (0x%x) from %!IPV4ADDR!:%d",
QuicTraceLogVerbose("[sock][%p] Received unreachable error (0x%x) from %!IPV4ADDR!:%d",
SocketContext,
ErrorCode,
&RemoteAddr->Ipv4.sin_addr,
ntohs(RemoteAddr->Ipv4.sin_port));
} else {
LogVerbose("[sock][%p] Received unreachable error (0x%x) from [%!IPV6ADDR!]:%d",
QuicTraceLogVerbose("[sock][%p] Received unreachable error (0x%x) from [%!IPV6ADDR!]:%d",
SocketContext,
ErrorCode,
&RemoteAddr->Ipv6.sin6_addr,
@ -1655,7 +1655,7 @@ Retry_recv:
QuicDataPathBindingHandleUnreachableError(SocketContext, (ULONG)WsaError);
goto Retry_recv;
} else {
EventWriteQuicDatapathErrorStatus(SocketContext->Binding, WsaError, "WSARecvMsg");
QuicTraceEvent(DatapathErrorStatus, SocketContext->Binding, WsaError, "WSARecvMsg");
Status = HRESULT_FROM_WIN32(WsaError);
goto Error;
}
@ -1670,7 +1670,7 @@ Retry_recv:
(ULONG_PTR)SocketContext,
&SocketContext->RecvOverlapped)) {
DWORD LastError = GetLastError();
EventWriteQuicDatapathErrorStatus(SocketContext->Binding, LastError, "PostQueuedCompletionStatus");
QuicTraceEvent(DatapathErrorStatus, SocketContext->Binding, LastError, "PostQueuedCompletionStatus");
Status = HRESULT_FROM_WIN32(LastError);
goto Error;
}
@ -1724,13 +1724,13 @@ QuicDataPathRecvComplete(
#ifdef QUIC_LOGS_WPP // TODO - Change to ETW event
if (RemoteAddr->si_family == AF_INET) {
LogVerbose("[sock][%p] Received larger than expected datagram from %!IPV4ADDR!:%d",
QuicTraceLogVerbose("[sock][%p] Received larger than expected datagram from %!IPV4ADDR!:%d",
SocketContext,
&RemoteAddr->Ipv4.sin_addr,
ntohs(RemoteAddr->Ipv4.sin_port));
}
else {
LogVerbose("[sock][%p] Received larger than expected datagram from [%!IPV6ADDR!]:%d",
QuicTraceLogVerbose("[sock][%p] Received larger than expected datagram from [%!IPV6ADDR!]:%d",
SocketContext,
&RemoteAddr->Ipv6.sin6_addr,
ntohs(RemoteAddr->Ipv6.sin6_port));
@ -1789,18 +1789,18 @@ QuicDataPathRecvComplete(
// The underlying data path does not guarantee ancillary data for
// enabled socket options when the system is under memory pressure.
//
LogWarning("[sock][%p] WSARecvMsg completion is missing IP_PKTINFO", SocketContext);
QuicTraceLogWarning("[sock][%p] WSARecvMsg completion is missing IP_PKTINFO", SocketContext);
goto Drop;
}
if (NumberOfBytesTransferred == 0) {
LogWarning("[sock][%p] Dropping datagram with empty payload.", SocketContext);
QuicTraceLogWarning("[sock][%p] Dropping datagram with empty payload.", SocketContext);
goto Drop;
}
QuicConvertFromMappedV6(RemoteAddr, RemoteAddr);
EventWriteQuicDatapathRecv(
QuicTraceEvent(DatapathRecv,
SocketContext->Binding,
NumberOfBytesTransferred,
MessageLength,
@ -1847,7 +1847,7 @@ QuicDataPathRecvComplete(
SocketContext->Binding->Datapath->DatagramStride);
if (IsCoalesced && ++MessageCount == URO_MAX_DATAGRAMS_PER_INDICATION) {
LogWarning("[%p] Exceeded URO preallocation capacity.", SocketContext);
QuicTraceLogWarning("[%p] Exceeded URO preallocation capacity.", SocketContext);
break;
}
}
@ -1875,7 +1875,7 @@ QuicDataPathRecvComplete(
DatagramChain);
} else {
EventWriteQuicDatapathErrorStatus(SocketContext->Binding, IoResult, "WSARecvMsg completion");
QuicTraceEvent(DatapathErrorStatus, SocketContext->Binding, IoResult, "WSARecvMsg completion");
}
Drop:
@ -2208,7 +2208,7 @@ QuicSendContextComplete(
)
{
if (IoResult != QUIC_STATUS_SUCCESS) {
EventWriteQuicDatapathErrorStatus(SocketContext->Binding, IoResult, "WSASendMsg completion");
QuicTraceEvent(DatapathErrorStatus, SocketContext->Binding, IoResult, "WSASendMsg completion");
}
QuicDataPathBindingFreeSendContext(SendContext);
@ -2244,7 +2244,7 @@ QuicDataPathBindingSendTo(
SocketContext = &Binding->SocketContexts[Binding->Connected ? 0 : GetCurrentProcessorNumber()];
Socket = SocketContext->Socket;
EventWriteQuicDatapathSendTo(
QuicTraceEvent(DatapathSendTo,
Binding,
SendContext->TotalSize,
SendContext->WsaBufferCount,
@ -2295,7 +2295,7 @@ QuicDataPathBindingSendTo(
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
if (WsaError != WSA_IO_PENDING) {
EventWriteQuicDatapathErrorStatus(SocketContext->Binding, WsaError, "WSASendMsg");
QuicTraceEvent(DatapathErrorStatus, SocketContext->Binding, WsaError, "WSASendMsg");
Status = HRESULT_FROM_WIN32(WsaError);
goto Exit;
}
@ -2352,7 +2352,7 @@ QuicDataPathBindingSendFromTo(
SocketContext = &Binding->SocketContexts[Binding->Connected ? 0 : GetCurrentProcessorNumber()];
Socket = SocketContext->Socket;
EventWriteQuicDatapathSendFromTo(
QuicTraceEvent(DatapathSendFromTo,
Binding,
SendContext->TotalSize,
SendContext->WsaBufferCount,
@ -2433,7 +2433,7 @@ QuicDataPathBindingSendFromTo(
if (Result == SOCKET_ERROR) {
int WsaError = WSAGetLastError();
if (WsaError != WSA_IO_PENDING) {
EventWriteQuicDatapathErrorStatus(SocketContext->Binding, WsaError, "WSASendMsg");
QuicTraceEvent(DatapathErrorStatus, SocketContext->Binding, WsaError, "WSASendMsg");
Status = HRESULT_FROM_WIN32(WsaError);
goto Exit;
}

Просмотреть файл

@ -482,7 +482,7 @@ Return Value:
if (*HashTable == NULL) {
Table = QUIC_ALLOC_NONPAGED(sizeof(QUIC_HASHTABLE));
if (Table == NULL) {
LogWarning("[ pal] Hashtable allocation failed.");
QuicTraceLogWarning("[ pal] Hashtable allocation failed.");
return FALSE;
}
@ -515,7 +515,7 @@ Return Value:
QUIC_ALLOC_NONPAGED(
QuicComputeSecondLevelDirSize(0) * sizeof(QUIC_LIST_ENTRY));
if (Table->SecondLevelDir == NULL) {
LogWarning("[ pal] Allocate second level dir (0) failure.");
QuicTraceLogWarning("[ pal] Allocate second level dir (0) failure.");
QuicHashtableUninitialize(Table);
return FALSE;
}
@ -548,7 +548,7 @@ Return Value:
QUIC_ALLOC_NONPAGED(
QuicComputeSecondLevelDirSize(i) * sizeof(QUIC_LIST_ENTRY));
if (Table->FirstLevelDir[i] == NULL) {
LogWarning("[ pal] Allocate second level dir (i) failure.");
QuicTraceLogWarning("[ pal] Allocate second level dir (i) failure.");
QuicHashtableUninitialize(Table);
return FALSE;
}

Просмотреть файл

@ -14,6 +14,8 @@ Environment:
--*/
#define _GNU_SOURCE
#define TRACEPOINT_CREATE_PROBES
#define TRACEPOINT_DEFINE
#include "platform_internal.h"
#include "quic_platform.h"
#include <limits.h>
@ -896,7 +898,7 @@ QuicThreadCreate(
pthread_attr_t Attr;
if (pthread_attr_init(&Attr)) {
LogError("[qpal] pthread_attr_init failed, 0x%x.", errno);
QuicTraceLogError("[qpal] pthread_attr_init failed, 0x%x.", errno);
return errno;
}
@ -908,7 +910,7 @@ QuicThreadCreate(
CPU_ZERO(&CpuSet);
CPU_SET(Config->IdealProcessor, &CpuSet);
if (!pthread_attr_setaffinity_np(&Attr, sizeof(CpuSet), &CpuSet)) {
LogWarning("[qpal] pthread_attr_setaffinity_np failed.");
QuicTraceLogWarning("[qpal] pthread_attr_setaffinity_np failed.");
}
} else {
// TODO - Set Linux equivalent of NUMA affinity.
@ -919,13 +921,13 @@ QuicThreadCreate(
struct sched_param Params;
Params.sched_priority = sched_get_priority_max(SCHED_FIFO);
if (!pthread_attr_setschedparam(&Attr, &Params)) {
LogWarning("[qpal] pthread_attr_setschedparam failed, 0x%x.");
QuicTraceLogWarning("[qpal] pthread_attr_setschedparam failed, 0x%x.");
}
}
if (pthread_create(Thread, &Attr, Config->Callback, Config->Context)) {
Status = errno;
LogError("[qpal] pthread_create failed, 0x%x.", Status);
QuicTraceLogError("[qpal] pthread_create failed, 0x%x.", Status);
}
pthread_attr_destroy(&Attr);
@ -967,7 +969,7 @@ QuicPlatformLogAssert(
_In_z_ const char* Expr
)
{
LogError("[Assert] %s:%s:%d:%s", Expr, Func, Line, File);
QuicTraceLogError("[Assert] %s:%s:%d:%s", Expr, Func, Line, File);
}
int
@ -1013,7 +1015,7 @@ QuicSysLogWrite(
va_list Args = {0};
#ifdef QUIC_PLATFORM_DISPATCH_TABLE
va_start(Args, Fmt);
PlatDispatch->Log(Level, Fmt, Args);
PlatDispatch->QuicTraceLog(Level, Fmt, Args);
va_end(Args);
#else
char Buffer[QUIC_MAX_LOG_MSG_LEN] = {0};

Просмотреть файл

@ -41,7 +41,7 @@ QuicPlatformSystemLoad(
(void)QueryPerformanceFrequency((LARGE_INTEGER*)&QuicPlatformPerfFreq);
QuicPlatform.Heap = NULL;
LogInfo("[ dll] Loaded");
QuicTraceLogInfo("[ dll] Loaded");
}
_IRQL_requires_max_(PASSIVE_LEVEL)
@ -50,7 +50,7 @@ QuicPlatformSystemUnload(
void
)
{
LogInfo("[ dll] Unloaded");
QuicTraceLogInfo("[ dll] Unloaded");
#ifdef QUIC_EVENTS_MANIFEST_ETW
EventUnregisterMicrosoft_Quic();
#endif
@ -77,7 +77,7 @@ QuicPlatformInitialize(
if (!GlobalMemoryStatusEx(&memInfo)) {
DWORD Error = GetLastError();
EventWriteQuicLibraryErrorStatus(Error, "GlobalMemoryStatusEx");
QuicTraceEvent(LibraryErrorStatus, Error, "GlobalMemoryStatusEx");
Status = HRESULT_FROM_WIN32(Error);
goto Error;
}
@ -89,7 +89,7 @@ QuicPlatformInitialize(
QuicTotalMemory = memInfo.ullTotalPageFile;
LogInfo("[ dll] Initialized (AvailMem = %llu bytes)", QuicTotalMemory);
QuicTraceLogInfo("[ dll] Initialized (AvailMem = %llu bytes)", QuicTotalMemory);
Error:
@ -113,7 +113,7 @@ QuicPlatformUninitialize(
QUIC_DBG_ASSERT(QuicPlatform.Heap);
HeapDestroy(QuicPlatform.Heap);
QuicPlatform.Heap = NULL;
LogInfo("[ dll] Uninitialized");
QuicTraceLogInfo("[ dll] Uninitialized");
}
_IRQL_requires_max_(DISPATCH_LEVEL)
@ -124,7 +124,7 @@ QuicPlatformLogAssert(
_In_z_ const char* Expr
)
{
EventWriteQuicLibraryAssert((uint32_t)Line, File, Expr);
QuicTraceEvent(LibraryAssert, (uint32_t)Line, File, Expr);
}
#ifdef QUIC_FUZZER

Просмотреть файл

@ -42,7 +42,7 @@ CleanTestCertificatesFromStore(BOOLEAN UserStore)
UserStore ? CERT_SYSTEM_STORE_CURRENT_USER : CERT_SYSTEM_STORE_LOCAL_MACHINE,
"MY");
if (CertStore == NULL) {
LogWarning("[cert] CertOpenStore failed, 0x%x.", GetLastError());
QuicTraceLogWarning("[cert] CertOpenStore failed, 0x%x.", GetLastError());
return;
}
@ -70,7 +70,7 @@ CleanTestCertificatesFromStore(BOOLEAN UserStore)
CertDeleteCertificateFromStore(CertDuplicateCertificateContext(Cert));
++Deleted;
}
LogInfo("[cert] %d test certificates found, and %d deleted", Found, Deleted);
QuicTraceLogInfo("[cert] %d test certificates found, and %d deleted", Found, Deleted);
CertCloseStore(CertStore, 0);
}
@ -110,7 +110,7 @@ AllocateAndEncodeObject(
NULL,
&CryptDataBlob->cbData)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CryptEncodeObject failed, 0x%x", hr);
QuicTraceLogError("[cert] CryptEncodeObject failed, 0x%x", hr);
goto Cleanup;
}
@ -121,7 +121,7 @@ AllocateAndEncodeObject(
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, CryptDataBlob->cbData);
hr = CryptDataBlob->pbData ? S_OK : E_OUTOFMEMORY;
if (FAILED(hr)) {
LogError("[cert] malloc cbData(%d) Failed", CryptDataBlob->cbData);
QuicTraceLogError("[cert] malloc cbData(%d) Failed", CryptDataBlob->cbData);
goto Cleanup;
}
@ -135,7 +135,7 @@ AllocateAndEncodeObject(
CryptDataBlob->pbData,
&CryptDataBlob->cbData)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CryptEncodeObject failed, 0x%x", hr);
QuicTraceLogError("[cert] CryptEncodeObject failed, 0x%x", hr);
goto Cleanup;
}
@ -168,7 +168,7 @@ CreateEnhancedKeyUsageCertExtension(
X509_ENHANCED_KEY_USAGE,
&CertEnhKeyUsage);
if (FAILED(hr)) {
LogError("[cert] AllocateAndEncodeObject X509_ENHANCED_KEY_USAGE failed, 0x%x", hr);
QuicTraceLogError("[cert] AllocateAndEncodeObject X509_ENHANCED_KEY_USAGE failed, 0x%x", hr);
goto Cleanup;
}
@ -197,7 +197,7 @@ CreateKeyUsageCertExtension(
X509_KEY_USAGE,
&KeyUsageBlob);
if (FAILED(hr)) {
LogError("[cert] AllocateAndEncodeObject X509_KEY_USAGE failed, 0x%x", hr);
QuicTraceLogError("[cert] AllocateAndEncodeObject X509_KEY_USAGE failed, 0x%x", hr);
goto Cleanup;
}
@ -228,7 +228,7 @@ CreateSubjAltNameExtension(
szOID_SUBJECT_ALT_NAME,
&NameInfo);
if (FAILED(hr)) {
LogError("[cert] AllocateAndEncodeObject(szOID_SUBJECT_ALT_NAME) Failed, 0x%x", hr);
QuicTraceLogError("[cert] AllocateAndEncodeObject(szOID_SUBJECT_ALT_NAME) Failed, 0x%x", hr);
goto Cleanup;
}
@ -259,14 +259,14 @@ CreateSubjectNameBlob(
&BufferLength,
NULL)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CreateSubjectNameBlob failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateSubjectNameBlob failed, 0x%x", hr);
goto Cleanup;
}
Buffer = (PBYTE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferLength);
hr = Buffer ? S_OK : E_OUTOFMEMORY;
if (FAILED(hr)) {
LogError("[cert] Failed to allocate memory for the encoded name., 0x%x", hr);
QuicTraceLogError("[cert] Failed to allocate memory for the encoded name., 0x%x", hr);
goto Cleanup;
}
@ -279,7 +279,7 @@ CreateSubjectNameBlob(
&BufferLength,
NULL)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CreateSubjectNameBlob failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateSubjectNameBlob failed, 0x%x", hr);
goto Cleanup;
}
@ -337,7 +337,7 @@ CreateCertificateExtensions(
(PCERT_EXTENSION)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CERT_EXTENSION) * cTmpCertExtension);
hr = TmpCertExtensions ? S_OK : E_OUTOFMEMORY;
if (FAILED(hr)) {
LogError("[cert] malloc TmpCertExtensions Failed, 0x%x", hr);
QuicTraceLogError("[cert] malloc TmpCertExtensions Failed, 0x%x", hr);
goto Cleanup;
}
@ -350,7 +350,7 @@ CreateCertificateExtensions(
//
hr = CreateEnhancedKeyUsageCertExtension(&TmpCertExtensions[0]);
if (FAILED(hr)) {
LogError("[cert] CreateEnhancedKeyUsageCertExtension failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateEnhancedKeyUsageCertExtension failed, 0x%x", hr);
goto Cleanup;
}
@ -360,7 +360,7 @@ CreateCertificateExtensions(
//
hr = CreateKeyUsageCertExtension(&TmpCertExtensions[1]);
if (FAILED(hr)) {
LogError("[cert] CreateKeyUsageCertExtension failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateKeyUsageCertExtension failed, 0x%x", hr);
goto Cleanup;
}
@ -369,7 +369,7 @@ CreateCertificateExtensions(
//
hr = CreateSubjAltNameExtension(&TmpCertExtensions[2]);
if (FAILED(hr)) {
LogError("[cert] CreateSubjAltNameExtension failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateSubjAltNameExtension failed, 0x%x", hr);
goto Cleanup;
}
@ -399,7 +399,7 @@ GetPrivateRsaKey(
&Provider,
MS_KEY_STORAGE_PROVIDER,
0))) {
LogError("[cert] NCryptOpenStorageProvider failed, 0x%x", hr);
QuicTraceLogError("[cert] NCryptOpenStorageProvider failed, 0x%x", hr);
goto Cleanup;
}
@ -416,10 +416,10 @@ ReadKey:
0,
NCRYPT_SILENT_FLAG);
if (hr == ERROR_SUCCESS) {
LogInfo("[cert] Successfully opened key");
QuicTraceLogInfo("[cert] Successfully opened key");
goto Cleanup;
} else if (hr != NTE_BAD_KEYSET) {
LogError("[cert] NCryptCreatePersistedKey failed, 0x%x", hr);
QuicTraceLogError("[cert] NCryptCreatePersistedKey failed, 0x%x", hr);
goto Cleanup;
}
@ -437,7 +437,7 @@ ReadKey:
if (hr == NTE_EXISTS) {
goto ReadKey; // Key already created, in other thread/process.
} else if (FAILED(hr)) {
LogError("[cert] NCryptCreatePersistedKey failed, 0x%x", hr);
QuicTraceLogError("[cert] NCryptCreatePersistedKey failed, 0x%x", hr);
goto Cleanup;
}
@ -447,7 +447,7 @@ ReadKey:
(PBYTE)&KeySize,
sizeof(KeySize),
0))) {
LogError("[cert] NCryptSetProperty NCRYPT_LENGTH_PROPERTY failed, 0x%x", hr);
QuicTraceLogError("[cert] NCryptSetProperty NCRYPT_LENGTH_PROPERTY failed, 0x%x", hr);
goto Cleanup;
}
@ -457,16 +457,16 @@ ReadKey:
(PBYTE)&KeyUsageProperty,
sizeof(KeyUsageProperty),
0))) {
LogError("[cert] NCryptSetProperty NCRYPT_KEY_USAGE_PROPERTY failed, 0x%x", hr);
QuicTraceLogError("[cert] NCryptSetProperty NCRYPT_KEY_USAGE_PROPERTY failed, 0x%x", hr);
goto Cleanup;
}
if (FAILED(hr = NCryptFinalizeKey(*Key, 0))) {
LogError("[cert] NCryptFinalizeKey failed, 0x%x", hr);
QuicTraceLogError("[cert] NCryptFinalizeKey failed, 0x%x", hr);
goto Cleanup;
}
LogInfo("[cert] Successfully created key");
QuicTraceLogInfo("[cert] Successfully created key");
Cleanup:
@ -508,7 +508,7 @@ CreateSelfSignedCertificate(
//
hr = CreateSubjectNameBlob(SubjectName, &SubjectNameBlob);
if (FAILED(hr)) {
LogError("[cert] CreateSubjectNameBlob failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateSubjectNameBlob failed, 0x%x", hr);
goto Cleanup;
}
@ -518,7 +518,7 @@ CreateSelfSignedCertificate(
//
hr = GetPrivateRsaKey(&Key);
if (FAILED(hr)) {
LogError("[cert] GetPrivateRsaKey failed, 0x%x", hr);
QuicTraceLogError("[cert] GetPrivateRsaKey failed, 0x%x", hr);
goto Cleanup;
}
@ -530,7 +530,7 @@ CreateSelfSignedCertificate(
hr = CreateCertificateExtensions(&extensions);
if (FAILED(hr)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CreateCertificateExtensions failed, 0x%x", hr);
QuicTraceLogError("[cert] CreateCertificateExtensions failed, 0x%x", hr);
goto Cleanup;
}
CleanupExtensions = TRUE;
@ -543,7 +543,7 @@ CreateSelfSignedCertificate(
FILETIME ExpiredFileTime;
if (!SystemTimeToFileTime(&Now, &ExpiredFileTime)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] SystemTimeToFileTime failed, 0x%x", hr);
QuicTraceLogError("[cert] SystemTimeToFileTime failed, 0x%x", hr);
goto Cleanup;
}
ULARGE_INTEGER FiveYearsFromNowLargeInt;
@ -556,7 +556,7 @@ CreateSelfSignedCertificate(
ExpiredFileTime.dwHighDateTime = FiveYearsFromNowLargeInt.HighPart;
if (!FileTimeToSystemTime(&ExpiredFileTime, &Expiration)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] FileTimeToSystemTime failed, 0x%x", hr);
QuicTraceLogError("[cert] FileTimeToSystemTime failed, 0x%x", hr);
goto Cleanup;
}
@ -583,7 +583,7 @@ CreateSelfSignedCertificate(
&extensions);
if (NULL == CertContext) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CertCreateSelfSignCertificate failed, 0x%x", hr);
QuicTraceLogError("[cert] CertCreateSelfSignCertificate failed, 0x%x", hr);
goto Cleanup;
}
@ -597,7 +597,7 @@ CreateSelfSignedCertificate(
0,
&FriendlyNameBlob)) {
hr = HRESULT_FROM_WIN32(GetLastError());
LogError("[cert] CertSetCertificateContextProperty failed, 0x%x", hr);
QuicTraceLogError("[cert] CertSetCertificateContextProperty failed, 0x%x", hr);
CertFreeCertificateContext(CertContext);
goto Cleanup;
}
@ -647,7 +647,7 @@ CreateServerCertificate(
CertContext,
CERT_STORE_ADD_NEW,
NULL)) {
LogError("[cert] CertAddCertificateContextToStore failed, 0x%x", GetLastError());
QuicTraceLogError("[cert] CertAddCertificateContextToStore failed, 0x%x", GetLastError());
}
CertCloseStore(CertStore, 0);
}
@ -680,7 +680,7 @@ FindOrCreateCertificate(
BOOLEAN First = FALSE;
HANDLE Event = CreateEventW(NULL, TRUE, FALSE, QUIC_CERT_CREATION_EVENT_NAME);
if (Event == NULL) {
LogError("[test] CreateEvent failed, 0x%x", GetLastError());
QuicTraceLogError("[test] CreateEvent failed, 0x%x", GetLastError());
return NULL;
}
@ -695,10 +695,10 @@ FindOrCreateCertificate(
// continue anyway.
//
if (GetLastError() == ERROR_ALREADY_EXISTS) {
LogInfo("[test] CreateEvent opened existing event");
QuicTraceLogInfo("[test] CreateEvent opened existing event");
DWORD WaitResult = WaitForSingleObject(Event, QUIC_CERT_CREATION_EVENT_WAIT);
if (WaitResult != WAIT_OBJECT_0) {
LogWarning(
QuicTraceLogWarning(
"[test] WaitForSingleObject returned 0x%x, proceeding without caution... (GLE: 0x%x)",
WaitResult,
GetLastError());
@ -715,7 +715,7 @@ FindOrCreateCertificate(
UserStore ? CERT_SYSTEM_STORE_CURRENT_USER : CERT_SYSTEM_STORE_LOCAL_MACHINE,
"MY");
if (CertStore == NULL) {
LogError("[test] CertOpenStore failed, 0x%x.", GetLastError());
QuicTraceLogError("[test] CertOpenStore failed, 0x%x.", GetLastError());
goto Done;
}
@ -759,7 +759,7 @@ FindOrCreateCertificate(
Cert,
CERT_STORE_ADD_ALWAYS,
NULL)) {
LogError("[test] CertAddCertificateContextToStore failed, 0x%x.", GetLastError());
QuicTraceLogError("[test] CertAddCertificateContextToStore failed, 0x%x.", GetLastError());
CertFreeCertificateContext(Cert);
Cert = NULL;
}
@ -772,7 +772,7 @@ Done:
CERT_HASH_PROP_ID,
CertHash,
&CertHashLength)) {
LogError("[test] CertGetCertificateContextProperty failed, 0x%x.", GetLastError());
QuicTraceLogError("[test] CertGetCertificateContextProperty failed, 0x%x.", GetLastError());
CertFreeCertificateContext(Cert);
Cert = NULL;
}

Просмотреть файл

@ -45,7 +45,7 @@ QuicTlsGenerateSelfSignedCert(
PKey = EVP_PKEY_new();
if (PKey == NULL) {
LogError("[TLS] EVP_PKEY_new() failed.");
QuicTraceLogError("[TLS] EVP_PKEY_new() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -53,7 +53,7 @@ QuicTlsGenerateSelfSignedCert(
BigNum = BN_new();
if (BigNum == NULL) {
LogError("[TLS] BN_new() failed.");
QuicTraceLogError("[TLS] BN_new() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -61,7 +61,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = BN_set_word(BigNum, RSA_F4);
if (Ret != 1) {
LogError("[TLS] BN_set_word() failed.");
QuicTraceLogError("[TLS] BN_set_word() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -69,7 +69,7 @@ QuicTlsGenerateSelfSignedCert(
Rsa = RSA_new();
if (Rsa == NULL) {
LogError("[TLS] RSA_new() failed.");
QuicTraceLogError("[TLS] RSA_new() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -77,7 +77,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = RSA_generate_key_ex(Rsa, 2048, BigNum, NULL);
if (Ret != 1) {
LogError("[TLS] RSA_generate_key_ex() failed.");
QuicTraceLogError("[TLS] RSA_generate_key_ex() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -85,7 +85,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = EVP_PKEY_assign_RSA(PKey, Rsa);
if (Ret != 1) {
LogError("[TLS] EVP_PKEY_assign_RSA() failed.");
QuicTraceLogError("[TLS] EVP_PKEY_assign_RSA() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -93,7 +93,7 @@ QuicTlsGenerateSelfSignedCert(
X509 = X509_new();
if (X509 == NULL) {
LogError("[TLS] X509_new() failed.");
QuicTraceLogError("[TLS] X509_new() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -101,7 +101,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = ASN1_INTEGER_set(X509_get_serialNumber(X509), 1);
if (Ret != 1) {
LogError("[TLS] ASN1_INTEGER_set() failed.");
QuicTraceLogError("[TLS] ASN1_INTEGER_set() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -124,7 +124,7 @@ QuicTlsGenerateSelfSignedCert(
0);
if (Ret != 1) {
LogError("[TLS] X509_NAME_add_entry_by_txt() failed.");
QuicTraceLogError("[TLS] X509_NAME_add_entry_by_txt() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -140,7 +140,7 @@ QuicTlsGenerateSelfSignedCert(
0);
if (Ret != 1) {
LogError("[TLS] X509_NAME_add_entry_by_txt() failed.");
QuicTraceLogError("[TLS] X509_NAME_add_entry_by_txt() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -156,7 +156,7 @@ QuicTlsGenerateSelfSignedCert(
0);
if (Ret != 1) {
LogError("[TLS] X509_NAME_add_entry_by_txt() failed.");
QuicTraceLogError("[TLS] X509_NAME_add_entry_by_txt() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -164,7 +164,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = X509_set_issuer_name(X509, Name);
if (Ret != 1) {
LogError("[TLS] X509_set_issuer_name() failed.");
QuicTraceLogError("[TLS] X509_set_issuer_name() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -172,7 +172,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = X509_sign(X509, PKey, EVP_sha1());
if (Ret <= 0) {
LogError("[TLS] X509_sign() failed.");
QuicTraceLogError("[TLS] X509_sign() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -180,7 +180,7 @@ QuicTlsGenerateSelfSignedCert(
Fd = fopen(PrivateKeyFileName, "wb");
if (Fd == NULL) {
LogError("[TLS] fopen() failed.");
QuicTraceLogError("[TLS] fopen() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -188,7 +188,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = PEM_write_PrivateKey(Fd, PKey, NULL, NULL, 0, NULL, NULL);
if (Ret != 1) {
LogError("[TLS] PEM_write_PrivateKey() failed.");
QuicTraceLogError("[TLS] PEM_write_PrivateKey() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -199,7 +199,7 @@ QuicTlsGenerateSelfSignedCert(
Fd = fopen(CertFileName, "wb");
if (Fd == NULL) {
LogError("[TLS] fopen() failed.");
QuicTraceLogError("[TLS] fopen() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -207,7 +207,7 @@ QuicTlsGenerateSelfSignedCert(
Ret = PEM_write_X509(Fd, X509);
if (Ret != 1) {
LogError("[TLS] PEM_write_X509() failed.");
QuicTraceLogError("[TLS] PEM_write_X509() failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -275,7 +275,7 @@ QuicPlatGetSelfSignedCert(
Params->TempDir = mkdtemp(Template);
if (Params->TempDir == NULL) {
LogError("[TLS] mkdtemp failed.");
QuicTraceLogError("[TLS] mkdtemp failed.");
goto Error;
}
@ -334,7 +334,7 @@ QuicPlatFreeSelfSignedCert(
strncpy(RmCmd, "rm -rf ", 7 + 1);
strncat(RmCmd, Params->TempDir, strlen(Params->TempDir) + 1);
if (system(RmCmd) == -1) {
LogError("[TLS] Tempdir del error.");
QuicTraceLogError("[TLS] Tempdir del error.");
}
free(Params);

Просмотреть файл

@ -96,7 +96,7 @@ QuicStorageOpen(
goto Exit;
}
LogVerbose("[ reg] Opening %s", FullKeyName);
QuicTraceLogVerbose("[ reg] Opening %s", FullKeyName);
Status =
HRESULT_FROM_WIN32(

Просмотреть файл

@ -381,7 +381,7 @@ MiTlsTraceCallback(
)
{
// TODO - Save connection in thread-local storage and retrieve it?
EventWriteQuicTlsMessage(NULL, Msg);
QuicTraceEvent(TlsMessage, NULL, Msg);
}
QUIC_STATUS
@ -391,18 +391,18 @@ QuicTlsLibraryInitialize(
{
QUIC_STATUS Status;
LogVerbose("[ tls] Initializing miTLS library");
QuicTraceLogVerbose("[ tls] Initializing miTLS library");
FFI_mitls_set_trace_callback(MiTlsTraceCallback);
if (!FFI_mitls_init()) {
Status = QUIC_STATUS_INVALID_STATE;
LogError("[ tls] FFI_mitls_init failed.");
QuicTraceLogError("[ tls] FFI_mitls_init failed.");
goto Error;
}
uint8_t Key[QUIC_IV_LENGTH + 32] = { 0 }; // Always use the same null key client side right now.
if (!FFI_mitls_set_sealing_key("AES256-GCM", Key, sizeof(Key))) {
Status = QUIC_STATUS_INVALID_STATE;
LogError("[ tls] FFI_mitls_set_sealing_key failed.");
QuicTraceLogError("[ tls] FFI_mitls_set_sealing_key failed.");
FFI_mitls_cleanup();
goto Error;
}
@ -413,7 +413,7 @@ QuicTlsLibraryInitialize(
QuicRandom(sizeof(Key), Key);
if (!FFI_mitls_set_ticket_key("AES256-GCM", Key, sizeof(Key))) {
Status = QUIC_STATUS_INVALID_STATE;
LogError("[ tls] FFI_mitls_set_ticket_key failed.");
QuicTraceLogError("[ tls] FFI_mitls_set_ticket_key failed.");
FFI_mitls_cleanup();
goto Error;
}
@ -430,7 +430,7 @@ QuicTlsLibraryUninitialize(
void
)
{
LogVerbose("[ tls] Cleaning up miTLS library");
QuicTraceLogVerbose("[ tls] Cleaning up miTLS library");
FFI_mitls_cleanup();
}
@ -474,7 +474,7 @@ QuicTlsServerSecConfigCreate(
}
if (!QuicRundownAcquire(Rundown)) {
LogError("[ tls] Failed to acquire sec config rundown.");
QuicTraceLogError("[ tls] Failed to acquire sec config rundown.");
Status = QUIC_STATUS_INVALID_STATE;
goto Error;
}
@ -709,7 +709,7 @@ QuicTlsSessionSetTicketKey(
{
UNREFERENCED_PARAMETER(TlsSession); // miTLS doesn't actually support sessions.
if (!FFI_mitls_set_ticket_key("AES256-GCM", (uint8_t*)Buffer, 44)) {
LogError("[ tls] FFI_mitls_set_ticket_key failed.");
QuicTraceLogError("[ tls] FFI_mitls_set_ticket_key failed.");
return QUIC_STATUS_INVALID_STATE;
}
return QUIC_STATUS_SUCCESS;
@ -857,7 +857,7 @@ QuicTlsSessionAddTicket(
(QUIC_TLS_TICKET_ENTRY*)QUIC_ALLOC_PAGED(TicketEntryLength);
if (TicketEntry == NULL) {
LogWarning("[tlss][%p] Failed to allocate ticket entry of %u bytes.", TlsSession, (uint32_t)TicketEntryLength);
QuicTraceLogWarning("[tlss][%p] Failed to allocate ticket entry of %u bytes.", TlsSession, (uint32_t)TicketEntryLength);
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -889,7 +889,7 @@ QuicTlsSessionCreateTicket(
(QUIC_TLS_TICKET_ENTRY*)QUIC_ALLOC_PAGED(TicketEntryLength);
if (TicketEntry == NULL) {
LogWarning("[tlss][%p] Failed to allocate ticket entry of %u bytes.", TlsSession, (uint32_t)TicketEntryLength);
QuicTraceLogWarning("[tlss][%p] Failed to allocate ticket entry of %u bytes.", TlsSession, (uint32_t)TicketEntryLength);
return NULL;
}
@ -921,7 +921,7 @@ QuicTlsInitialize(
TlsContext = QUIC_ALLOC_PAGED(sizeof(QUIC_TLS));
if (TlsContext == NULL) {
LogWarning("[ tls] Failed to allocate QUIC_TLS.");
QuicTraceLogWarning("[ tls] Failed to allocate QUIC_TLS.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -977,14 +977,14 @@ QuicTlsInitialize(
const size_t ServerNameLength =
strnlen(Config->ServerName, QUIC_MAX_SNI_LENGTH + 1);
if (ServerNameLength == QUIC_MAX_SNI_LENGTH + 1) {
LogError("[ tls][%p] Invalid / Too long server name!", TlsContext);
QuicTraceLogError("[ tls][%p] Invalid / Too long server name!", TlsContext);
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Error;
}
TlsContext->SNI = QUIC_ALLOC_PAGED(ServerNameLength + 1);
if (TlsContext->SNI == NULL) {
LogWarning("[ tls][%p] Failed to allocate SNI.", TlsContext);
QuicTraceLogWarning("[ tls][%p] Failed to allocate SNI.", TlsContext);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -1001,7 +1001,7 @@ QuicTlsInitialize(
if (TlsContext->Ticket != NULL) {
LogVerbose("[ tls][%p] Using 0-RTT ticket.", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Using 0-RTT ticket.", TlsContext);
TlsContext->miTlsTicket.ticket_len = TlsContext->Ticket->TicketLength;
TlsContext->miTlsTicket.ticket =
@ -1032,7 +1032,7 @@ QuicTlsInitialize(
// Initialize the miTLS library.
//
if (!FFI_mitls_quic_create(&TlsContext->miTlsState, &TlsContext->miTlsConfig)) {
LogError("[ tls][%p] FFI_mitls_quic_create failed.", TlsContext);
QuicTraceLogError("[ tls][%p] FFI_mitls_quic_create failed.", TlsContext);
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Error;
}
@ -1110,7 +1110,7 @@ QuicTlsReset(
// Reinitialize new miTLS state.
//
if (!FFI_mitls_quic_create(&TlsContext->miTlsState, &TlsContext->miTlsConfig)) {
LogError("[ tls][%p] FFI_mitls_quic_create failed.", TlsContext);
QuicTraceLogError("[ tls][%p] FFI_mitls_quic_create failed.", TlsContext);
QUIC_DBG_ASSERT(FALSE);
}
}
@ -1144,14 +1144,14 @@ QuicTlsProcessData(
//
if (TlsContext->BufferLength + *BufferLength > QUIC_TLS_MAX_MESSAGE_LENGTH) {
ResultFlags = QUIC_TLS_RESULT_ERROR;
LogError("[ tls][%p] Error: Attempt to write too much buffer.", TlsContext);
QuicTraceLogError("[ tls][%p] Error: Attempt to write too much buffer.", TlsContext);
goto Error;
}
TlsContext->State = State;
if (*BufferLength) {
LogVerbose("[ tls][%p] Writing %d bytes", TlsContext, *BufferLength);
QuicTraceLogVerbose("[ tls][%p] Writing %d bytes", TlsContext, *BufferLength);
//
// Copy the data pointer into our buffer pointer.
@ -1211,7 +1211,7 @@ QuicTlsProcessDataComplete(
0
};
LogVerbose(
QuicTraceLogVerbose(
"[ tls][%p] FFI_mitls_quic_process processing %d input bytes.",
TlsContext, (uint32_t)Context.input_len);
@ -1219,7 +1219,7 @@ QuicTlsProcessDataComplete(
// Pass the data to miTLS for processing.
//
if (!FFI_mitls_quic_process(TlsContext->miTlsState, &Context)) {
LogError(
QuicTraceLogError(
"[ tls][%p] FFI_mitls_quic_process failed, tls_error %hu, %s.",
TlsContext, Context.tls_error, Context.tls_error_desc);
State->AlertCode = Context.tls_error;
@ -1227,7 +1227,7 @@ QuicTlsProcessDataComplete(
break;
}
LogVerbose(
QuicTraceLogVerbose(
"[ tls][%p] FFI_mitls_quic_process read %u bytes and has %u bytes ready to send.",
TlsContext, (uint32_t)Context.consumed_bytes, (uint32_t)Context.output_len);
@ -1247,14 +1247,14 @@ QuicTlsProcessDataComplete(
}
if (Context.flags & QFLAG_COMPLETE && !State->HandshakeComplete) {
LogVerbose("[ tls][%p] Handshake complete", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Handshake complete", TlsContext);
State->HandshakeComplete = TRUE;
ResultFlags |= QUIC_TLS_RESULT_COMPLETE;
if (TlsContext->IsServer) {
LogVerbose("[ tls][%p] Sending new 0-RTT ticket", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Sending new 0-RTT ticket", TlsContext);
if (!FFI_mitls_quic_send_ticket(TlsContext->miTlsState, NULL, 0)) {
LogError("[ tls][%p] Failed to send 0-RTT ticket!", TlsContext);
QuicTraceLogError("[ tls][%p] Failed to send 0-RTT ticket!", TlsContext);
}
}
}
@ -1266,7 +1266,7 @@ QuicTlsProcessDataComplete(
if (State->EarlyDataAttempted) {
ResultFlags |= QUIC_TLS_RESULT_EARLY_DATA_REJECT;
}
LogVerbose("[ tls][%p] Early data rejected", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Early data rejected", TlsContext);
}
BOOLEAN ReadKeyUpdated = Context.cur_reader_key != TlsContext->CurrentReaderKey;
@ -1289,7 +1289,7 @@ QuicTlsProcessDataComplete(
// We know early data is accepted if we get 0-RTT keys.
//
ResultFlags |= QUIC_TLS_RESULT_EARLY_DATA_ACCEPT;
LogVerbose("[ tls][%p] Early data accepted", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Early data accepted", TlsContext);
TlsContext->TlsKeySchedule = 1; // 0-RTT allowed.
State->SessionResumed = TRUE;
State->EarlyDataAttempted = TRUE;
@ -1297,19 +1297,19 @@ QuicTlsProcessDataComplete(
} else {
TlsContext->TlsKeySchedule = 0;
if (!(Context.flags & QFLAG_REJECTED_0RTT)) {
LogVerbose("[ tls][%p] Early data not attempted", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Early data not attempted", TlsContext);
}
}
} else {
if (WriteKeyUpdated) {
LogVerbose("[ tls][%p] Early data attempted", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Early data attempted", TlsContext);
TlsContext->TlsKeySchedule = 1; // 0-RTT allowed.
State->EarlyDataAttempted = TRUE;
} else {
TlsContext->TlsKeySchedule = 0;
}
}
LogVerbose("[ tls][%p] Key schedule = %hu", TlsContext, TlsContext->TlsKeySchedule);
QuicTraceLogVerbose("[ tls][%p] Key schedule = %hu", TlsContext, TlsContext->TlsKeySchedule);
TlsContext->TlsKeyScheduleSet = TRUE;
}
@ -1324,13 +1324,13 @@ QuicTlsProcessDataComplete(
&State->ReadKeys[NewKeyType])) {
switch (NewKeyType) {
case QUIC_PACKET_KEY_0_RTT:
LogVerbose("[ tls][%p] 0-RTT read key exported", TlsContext);
QuicTraceLogVerbose("[ tls][%p] 0-RTT read key exported", TlsContext);
break;
case QUIC_PACKET_KEY_HANDSHAKE:
LogVerbose("[ tls][%p] Handshake read key exported", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Handshake read key exported", TlsContext);
break;
case QUIC_PACKET_KEY_1_RTT:
LogVerbose("[ tls][%p] 1-RTT read key exported", TlsContext);
QuicTraceLogVerbose("[ tls][%p] 1-RTT read key exported", TlsContext);
if (!TlsContext->IsServer) {
if (State->EarlyDataAttempted &&
!(Context.flags & QFLAG_REJECTED_0RTT)) {
@ -1342,7 +1342,7 @@ QuicTlsProcessDataComplete(
ResultFlags |= QUIC_TLS_RESULT_EARLY_DATA_ACCEPT;
State->SessionResumed = TRUE;
State->EarlyDataAccepted = TRUE;
LogVerbose("[ tls][%p] Early data accepted", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Early data accepted", TlsContext);
}
}
break;
@ -1377,13 +1377,13 @@ QuicTlsProcessDataComplete(
&State->WriteKeys[NewKeyType])) {
switch (NewKeyType) {
case QUIC_PACKET_KEY_0_RTT:
LogVerbose("[ tls][%p] 0-RTT write key exported", TlsContext);
QuicTraceLogVerbose("[ tls][%p] 0-RTT write key exported", TlsContext);
break;
case QUIC_PACKET_KEY_HANDSHAKE:
LogVerbose("[ tls][%p] Handshake write key exported", TlsContext);
QuicTraceLogVerbose("[ tls][%p] Handshake write key exported", TlsContext);
break;
case QUIC_PACKET_KEY_1_RTT:
LogVerbose("[ tls][%p] 1-RTT write key exported", TlsContext);
QuicTraceLogVerbose("[ tls][%p] 1-RTT write key exported", TlsContext);
break;
default:
QUIC_FRE_ASSERT(FALSE);
@ -1396,11 +1396,11 @@ QuicTlsProcessDataComplete(
break;
case QUIC_PACKET_KEY_HANDSHAKE:
State->BufferOffsetHandshake = State->BufferTotalLength;
LogVerbose("[ tls][%p] Handshake write offset = %u", TlsContext, State->BufferOffsetHandshake);
QuicTraceLogVerbose("[ tls][%p] Handshake write offset = %u", TlsContext, State->BufferOffsetHandshake);
break;
case QUIC_PACKET_KEY_1_RTT:
State->BufferOffset1Rtt = State->BufferTotalLength;
LogVerbose("[ tls][%p] 1-RTT write offset = %u", TlsContext, State->BufferOffset1Rtt);
QuicTraceLogVerbose("[ tls][%p] 1-RTT write offset = %u", TlsContext, State->BufferOffset1Rtt);
break;
default:
QUIC_FRE_ASSERT(FALSE);
@ -1425,7 +1425,7 @@ QuicTlsProcessDataComplete(
TlsContext->Buffer = NULL;
*BufferConsumed = BufferOffset;
LogVerbose("[ tls][%p] Consumed %d bytes", TlsContext, BufferOffset);
QuicTraceLogVerbose("[ tls][%p] Consumed %d bytes", TlsContext, BufferOffset);
if (TlsContext->TicketReady) {
ResultFlags |= QUIC_TLS_RESULT_TICKET;
@ -1457,13 +1457,13 @@ QuicTlsOnCertSelect(
QUIC_DBG_ASSERT(TlsContext);
QUIC_DBG_ASSERT(TlsContext->IsServer);
LogVerbose("[ tls][%p] OnCertSelect", TlsContext);
QuicTraceLogVerbose("[ tls][%p] OnCertSelect", TlsContext);
//
// Only allow TLS 1.3.
//
if (TlsVersion != TLS_1p3) {
LogError("[ tls][%p] Unsupported TLS version %hu", TlsContext, TlsVersion);
QuicTraceLogError("[ tls][%p] Unsupported TLS version %hu", TlsContext, TlsVersion);
goto Error;
}
@ -1472,14 +1472,14 @@ QuicTlsOnCertSelect(
//
if (ServerNameIndicationLength >= QUIC_MAX_SNI_LENGTH) {
LogError("[ tls][%p] Too long server name!", TlsContext);
QuicTraceLogError("[ tls][%p] Too long server name!", TlsContext);
goto Error;
}
if (ServerNameIndicationLength != 0) {
TlsContext->SNI = QUIC_ALLOC_PAGED((uint16_t)(ServerNameIndicationLength + 1));
if (TlsContext->SNI == NULL) {
LogWarning("[ tls][%p] Failed to allocate SNI.", TlsContext);
QuicTraceLogWarning("[ tls][%p] Failed to allocate SNI.", TlsContext);
goto Error;
}
@ -1506,24 +1506,24 @@ QuicTlsOnCertSelect(
SignatureAlgorithmsLength,
SelectedSignature)) {
if (SignatureAlgorithmsLength == 1) {
LogError("[ tls][%p] No matching signature algorithms, {0x%hx}",
QuicTraceLogError("[ tls][%p] No matching signature algorithms, {0x%hx}",
TlsContext, SignatureAlgorithms[0]);
} else if (SignatureAlgorithmsLength == 2) {
LogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx}",
QuicTraceLogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx}",
TlsContext, SignatureAlgorithms[0], SignatureAlgorithms[1]);
} else if (SignatureAlgorithmsLength == 3) {
LogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx}",
QuicTraceLogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx}",
TlsContext, SignatureAlgorithms[0], SignatureAlgorithms[1], SignatureAlgorithms[2]);
} else if (SignatureAlgorithmsLength == 4) {
LogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx, 0x%hx}",
QuicTraceLogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx, 0x%hx}",
TlsContext, SignatureAlgorithms[0], SignatureAlgorithms[1], SignatureAlgorithms[2],
SignatureAlgorithms[3]);
} else if (SignatureAlgorithmsLength == 5) {
LogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx}",
QuicTraceLogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx}",
TlsContext, SignatureAlgorithms[0], SignatureAlgorithms[1], SignatureAlgorithms[2],
SignatureAlgorithms[3], SignatureAlgorithms[4]);
} else {
LogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, ...}",
QuicTraceLogError("[ tls][%p] No matching signature algorithms, {0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, ...}",
TlsContext, SignatureAlgorithms[0], SignatureAlgorithms[1], SignatureAlgorithms[2],
SignatureAlgorithms[3], SignatureAlgorithms[4], SignatureAlgorithms[5]);
}
@ -1531,7 +1531,7 @@ QuicTlsOnCertSelect(
goto Error;
}
LogInfo("[ tls][%p] Server certificate selected. SNI: %s; Algorithm: 0x%4.4x",
QuicTraceLogInfo("[ tls][%p] Server certificate selected. SNI: %s; Algorithm: 0x%4.4x",
TlsContext, TlsContext->SNI, *SelectedSignature);
Error:
@ -1568,13 +1568,13 @@ QuicTlsOnNegotiate(
UNREFERENCED_PARAMETER(Cookie);
UNREFERENCED_PARAMETER(CookieLength);
LogVerbose("[ tls][%p] OnNegotiate", TlsContext);
QuicTraceLogVerbose("[ tls][%p] OnNegotiate", TlsContext);
//
// Only allow TLS 1.3.
//
if (Version != TLS_1p3) {
LogError("[ tls][%p] Unsupported TLS version %hu", TlsContext, Version);
QuicTraceLogError("[ tls][%p] Unsupported TLS version %hu", TlsContext, Version);
goto Exit;
}
@ -1589,7 +1589,7 @@ QuicTlsOnNegotiate(
TLS_EXTENSION_TYPE_QUIC_TRANSPORT_PARAMETERS,
&TransportParams,
&TransportParamsLength)) {
LogError("[ tls][%p] Missing QUIC transport parameters.", TlsContext);
QuicTraceLogError("[ tls][%p] Missing QUIC transport parameters.", TlsContext);
goto Exit;
}
@ -1597,7 +1597,7 @@ QuicTlsOnNegotiate(
TlsContext->Connection,
(uint16_t)TransportParamsLength,
TransportParams)) {
LogError("[ tls][%p] Failed to process the QUIC transport parameters.", TlsContext);
QuicTraceLogError("[ tls][%p] Failed to process the QUIC transport parameters.", TlsContext);
goto Exit;
}
@ -1633,7 +1633,7 @@ QuicTlsOnCertFormat(
QUIC_SEC_CONFIG* SecurityConfig = (QUIC_SEC_CONFIG*)SecContext;
QUIC_DBG_ASSERT(SecurityConfig);
LogVerbose("[ tls][%p] OnCertFormat", TlsContext);
QuicTraceLogVerbose("[ tls][%p] OnCertFormat", TlsContext);
QUIC_DBG_ASSERT(SecurityConfig->FormatLength <= MAX_CHAIN_LEN);
if (SecurityConfig->FormatLength > MAX_CHAIN_LEN) {
@ -1661,7 +1661,7 @@ QuicTlsOnCertSign(
QUIC_SEC_CONFIG* SecurityConfig = (QUIC_SEC_CONFIG*)SecContext;
QUIC_DBG_ASSERT(SecurityConfig);
LogVerbose("[ tls][%p] OnCertSign", TlsContext);
QuicTraceLogVerbose("[ tls][%p] OnCertSign", TlsContext);
size_t SignatureLength = MAX_SIGNATURE_LEN;
@ -1698,13 +1698,13 @@ QuicTlsOnCertVerify(
QUIC_TLS* TlsContext = (QUIC_TLS*)Context;
QUIC_DBG_ASSERT(TlsContext);
LogVerbose("[ tls][%p] OnCertVerify", TlsContext);
QuicTraceLogVerbose("[ tls][%p] OnCertVerify", TlsContext);
int Result = 0;
QUIC_CERT* Certificate = NULL;
if (TlsContext->SecConfig->Flags & QUIC_CERTIFICATE_FLAG_DISABLE_CERT_VALIDATION) {
LogWarning("[ tls][%p] Certificate validation disabled!", TlsContext);
QuicTraceLogWarning("[ tls][%p] Certificate validation disabled!", TlsContext);
Result = 1;
goto Error;
}
@ -1714,7 +1714,7 @@ QuicTlsOnCertVerify(
ChainBufferLength,
ChainBuffer);
if (Certificate == NULL) {
LogError("[ tls][%p] failed to parse certificate chain.", TlsContext);
QuicTraceLogError("[ tls][%p] failed to parse certificate chain.", TlsContext);
goto Error;
}
@ -1722,7 +1722,7 @@ QuicTlsOnCertVerify(
Certificate,
TlsContext->SNI,
TlsContext->SecConfig->Flags)) {
LogError("[ tls][%p] Cert chain validation failed.", TlsContext);
QuicTraceLogError("[ tls][%p] Cert chain validation failed.", TlsContext);
Result = 0;
goto Error;
}
@ -1757,7 +1757,7 @@ QuicTlsOnTicketReady(
QUIC_TLS* TlsContext = (QUIC_TLS*)Context;
QUIC_DBG_ASSERT(TlsContext);
LogVerbose("[ tls][%p] Received new ticket. ticket_len:%d session_len:%d for %s",
QuicTraceLogVerbose("[ tls][%p] Received new ticket. ticket_len:%d session_len:%d for %s",
TlsContext, (uint32_t)Ticket->ticket_len, (uint32_t)Ticket->session_len, ServerNameIndication);
//
@ -1814,7 +1814,7 @@ QuicTlsReadTicket(
goto Exit;
}
LogVerbose("[ tls][%p] Ticket (%u bytes) read.", TlsContext, TicketBufferLength);
QuicTraceLogVerbose("[ tls][%p] Ticket (%u bytes) read.", TlsContext, TicketBufferLength);
QuicCopyMemory(
Buffer,
@ -1927,7 +1927,7 @@ QuicTlsLogSecret(
SecretStr[i*2] = HEX_TO_CHAR(Secret[i] >> 4);
SecretStr[i*2 + 1] = HEX_TO_CHAR(Secret[i] & 0xf);
}
LogVerbose("[ tls] %s[%u]: %s", Prefix, Length, SecretStr);
QuicTraceLogVerbose("[ tls] %s[%u]: %s", Prefix, Length, SecretStr);
}
#else
#define QuicTlsLogSecret(Prefix, Secret, Length) UNREFERENCED_PARAMETER(Prefix)
@ -2108,7 +2108,7 @@ QuicPacketKeyDerive(
(KeyType == QUIC_PACKET_KEY_1_RTT ? sizeof(QUIC_SECRET) : 0);
QUIC_PACKET_KEY *Key = QUIC_ALLOC_NONPAGED(PacketKeyLength);
if (Key == NULL) {
LogWarning("[ tls] Failed to allocate packet key.");
QuicTraceLogWarning("[ tls] Failed to allocate packet key.");
return QUIC_STATUS_OUT_OF_MEMORY;
}
QuicZeroMemory(Key, sizeof(QUIC_PACKET_KEY));
@ -2303,7 +2303,7 @@ QuicPacketKeyCreate(
Epoch,
rw);
if (Result == FALSE) {
LogError("[ tls][%p] FFI_mitls_quic_get_record_key failed.", TlsContext);
QuicTraceLogError("[ tls][%p] FFI_mitls_quic_get_record_key failed.", TlsContext);
goto Error;
}
@ -2312,7 +2312,7 @@ QuicPacketKeyCreate(
(KeyType == QUIC_PACKET_KEY_1_RTT ? sizeof(QUIC_SECRET) : 0);
Key = QUIC_ALLOC_NONPAGED(PacketKeyLength);
if (Key == NULL) {
LogWarning("[ tls][%p] Failed to allocate packet key.", TlsContext);
QuicTraceLogWarning("[ tls][%p] Failed to allocate packet key.", TlsContext);
Result = FALSE;
goto Error;
}
@ -2347,7 +2347,7 @@ QuicPacketKeyCreate(
&ClientReadSecret,
&ServerReadSecret);
if (Result == FALSE) {
LogError("[ tls][%p] FFI_mitls_quic_get_record_secrets failed.", TlsContext);
QuicTraceLogError("[ tls][%p] FFI_mitls_quic_get_record_secrets failed.", TlsContext);
goto Error;
}
quic_secret* CopySecret;
@ -2368,7 +2368,7 @@ QuicPacketKeyCreate(
Key->TrafficSecret->Hash = QUIC_HASH_SHA512;
break;
default:
LogError("[ tls][%p] Unsupported hash type.", TlsContext);
QuicTraceLogError("[ tls][%p] Unsupported hash type.", TlsContext);
Result = FALSE;
goto Error;
}
@ -2487,7 +2487,7 @@ QuicKeyCreate(
QUIC_KEY* Key = QUIC_ALLOC_NONPAGED(sizeof(QUIC_KEY));
if (Key == NULL) {
LogWarning("[ tls] Failed to allocate key.");
QuicTraceLogWarning("[ tls] Failed to allocate key.");
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -2615,7 +2615,7 @@ QuicHpKeyCreate(
QUIC_HP_KEY* Key = QUIC_ALLOC_NONPAGED(sizeof(QUIC_KEY));
if (Key == NULL) {
LogWarning("[ tls] Failed to allocate key.");
QuicTraceLogWarning("[ tls] Failed to allocate key.");
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -2700,7 +2700,7 @@ QuicHashCreate(
QUIC_HASH* Hash = QUIC_ALLOC_NONPAGED(sizeof(QUIC_HASH) + SaltLength);
if (Hash == NULL) {
LogWarning("[ tls] Failed to allocate hash.");
QuicTraceLogWarning("[ tls] Failed to allocate hash.");
return QUIC_STATUS_OUT_OF_MEMORY;
}

Просмотреть файл

@ -435,7 +435,7 @@ QuicTlsLibraryInitialize(
int Ret = 0;
if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL) == 0) {
LogError("[ tls] OPENSSL_init_ssl failed.");
QuicTraceLogError("[ tls] OPENSSL_init_ssl failed.");
return QUIC_STATUS_TLS_ERROR;
}
@ -490,7 +490,7 @@ QuicTlsAlpnSelectCallback(
}
}
LogError("[ tls] Client did not present correct ALPN");
QuicTraceLogError("[ tls] Client did not present correct ALPN");
return SSL_TLSEXT_ERR_NOACK;
}
@ -514,7 +514,7 @@ QuicTlsSetEncryptionSecretsCallback(
QUIC_PACKET_KEY_TYPE KeyType = (QUIC_PACKET_KEY_TYPE)Level;
QUIC_STATUS Status;
LogVerbose("[ tls][%p][%c] New encryption secrets (Level = %u).",
QuicTraceLogVerbose("[ tls][%p][%c] New encryption secrets (Level = %u).",
TlsContext, GetTlsIdentifier(TlsContext), Level);
QUIC_DBG_ASSERT(TlsState->WriteKeys[KeyType] == NULL);
@ -573,11 +573,11 @@ QuicTlsAddHandshakeDataCallback(
QUIC_PACKET_KEY_TYPE KeyType = (QUIC_PACKET_KEY_TYPE)Level;
QUIC_DBG_ASSERT(TlsState->WriteKeys[KeyType] != NULL);
LogVerbose("[ tls][%p][%c] Sending %llu handshake bytes (Level = %u).",
QuicTraceLogVerbose("[ tls][%p][%c] Sending %llu handshake bytes (Level = %u).",
TlsContext, GetTlsIdentifier(TlsContext), Length, Level);
if (Length + TlsState->BufferLength > (size_t)TlsState->BufferAllocLength) {
LogError("[ tls][%p][%c] Buffer overflow for output handshake data.",
QuicTraceLogError("[ tls][%p][%c] Buffer overflow for output handshake data.",
TlsContext, GetTlsIdentifier(TlsContext));
TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR;
return -1;
@ -587,14 +587,14 @@ QuicTlsAddHandshakeDataCallback(
case QUIC_PACKET_KEY_HANDSHAKE:
if (TlsState->BufferOffsetHandshake == 0) {
TlsState->BufferOffsetHandshake = TlsState->BufferTotalLength;
LogInfo("[ tls][%p][%c] Writing Handshake data starts at %u.",
QuicTraceLogInfo("[ tls][%p][%c] Writing Handshake data starts at %u.",
TlsContext, GetTlsIdentifier(TlsContext), TlsState->BufferOffsetHandshake);
}
break;
case QUIC_PACKET_KEY_1_RTT:
if (TlsState->BufferOffset1Rtt == 0) {
TlsState->BufferOffset1Rtt = TlsState->BufferTotalLength;
LogInfo("[ tls][%p][%c] Writing 1-RTT data starts at %u.",
QuicTraceLogInfo("[ tls][%p][%c] Writing 1-RTT data starts at %u.",
TlsContext, GetTlsIdentifier(TlsContext), TlsState->BufferOffset1Rtt);
}
break;
@ -634,7 +634,7 @@ QuicTlsSendAlertCallback(
QUIC_TLS* TlsContext = SSL_get_app_data(Ssl);
LogError("[ tls][%p][%c] Send alert = %u (Level = %u).",
QuicTraceLogError("[ tls][%p][%c] Send alert = %u (Level = %u).",
TlsContext, GetTlsIdentifier(TlsContext), Alert, Level);
TlsContext->State->AlertCode = Alert;
@ -704,19 +704,19 @@ QuicTlsServerSecConfigCreate(
//
if (Flags != QUIC_SEC_CONFIG_FLAG_CERTIFICATE_FILE) {
LogError("[ tls] Invalid flags: %lu.", Flags);
QuicTraceLogError("[ tls] Invalid flags: %lu.", Flags);
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Exit;
}
if (CertFile == NULL) {
LogError("[ tls] CertFile unspecified.");
QuicTraceLogError("[ tls] CertFile unspecified.");
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Exit;
}
if (!QuicRundownAcquire(Rundown)) {
LogError("[ tls] Failed to acquire sec config rundown.");
QuicTraceLogError("[ tls] Failed to acquire sec config rundown.");
Status = QUIC_STATUS_INVALID_STATE;
goto Exit;
}
@ -727,7 +727,7 @@ QuicTlsServerSecConfigCreate(
SecurityConfig = QuicAlloc(sizeof(QUIC_SEC_CONFIG));
if (SecurityConfig == NULL) {
LogError("[ tls] Security config allocation failure.");
QuicTraceLogError("[ tls] Security config allocation failure.");
QuicRundownRelease(Rundown);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
@ -747,7 +747,7 @@ QuicTlsServerSecConfigCreate(
SecurityConfig->SSLCtx = SSL_CTX_new(TLS_method());
if (SecurityConfig->SSLCtx == NULL) {
LogError("[ tls] SSL_CTX_new failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_new failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -769,7 +769,7 @@ QuicTlsServerSecConfigCreate(
SecurityConfig->SSLCtx,
QUIC_TLS_DEFAULT_SSL_CIPHERS);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_set_ciphersuites failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_set_ciphersuites failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -779,7 +779,7 @@ QuicTlsServerSecConfigCreate(
SecurityConfig->SSLCtx,
QUIC_TLS_DEFAULT_SSL_CURVES);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_set1_groups_list failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_set1_groups_list failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -803,7 +803,7 @@ QuicTlsServerSecConfigCreate(
CertFile->PrivateKeyFile,
SSL_FILETYPE_PEM);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_use_PrivateKey_file failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_use_PrivateKey_file failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -813,14 +813,14 @@ QuicTlsServerSecConfigCreate(
SecurityConfig->SSLCtx,
CertFile->CertificateFile);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_use_certificate_chain_file failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_use_certificate_chain_file failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
Ret = SSL_CTX_check_private_key(SecurityConfig->SSLCtx);
if (Ret != 1) {
LogError("TLS: SSL_CTX_check_private_key failed, error: %ld", ERR_get_error());
QuicTraceLogError("TLS: SSL_CTX_check_private_key failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -886,7 +886,7 @@ QuicTlsClientSecConfigCreate(
SecurityConfig = QuicAlloc(sizeof(QUIC_SEC_CONFIG));
if (SecurityConfig == NULL) {
LogError("[ tls] SecurityConfig alloc failed.");
QuicTraceLogError("[ tls] SecurityConfig alloc failed.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -902,7 +902,7 @@ QuicTlsClientSecConfigCreate(
SecurityConfig->SSLCtx = SSL_CTX_new(TLS_method());
if (SecurityConfig->SSLCtx == NULL) {
LogError("[ tls] SSL_CTX_new failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_new failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -921,7 +921,7 @@ QuicTlsClientSecConfigCreate(
SecurityConfig->SSLCtx,
QUIC_TLS_DEFAULT_SSL_CIPHERS);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_set_ciphersuites failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_set_ciphersuites failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -931,7 +931,7 @@ QuicTlsClientSecConfigCreate(
SecurityConfig->SSLCtx,
QUIC_TLS_DEFAULT_SSL_CURVES);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_set1_groups_list failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_set1_groups_list failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -963,7 +963,7 @@ QuicTlsClientSecConfigCreate(
QuicOpenSslClientTrustedCert,
NULL);
if (Ret != 1) {
LogError("[ tls] SSL_CTX_load_verify_locations failed, error: %ld", ERR_get_error());
QuicTraceLogError("[ tls] SSL_CTX_load_verify_locations failed, error: %ld", ERR_get_error());
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1022,7 +1022,7 @@ QuicTlsSessionInitialize(
TlsSession = QuicAlloc(sizeof(QUIC_TLS_SESSION) + ALPNLength + 1);
if (TlsSession == NULL) {
LogWarning("[ tls] Failed to allocate QUIC_TLS_SESSION.");
QuicTraceLogWarning("[ tls] Failed to allocate QUIC_TLS_SESSION.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -1103,7 +1103,7 @@ QuicTlsInitialize(
TlsContext = QuicAlloc(sizeof(QUIC_TLS));
if (TlsContext == NULL) {
LogError("[ tls] Failed to allocate TLS context.");
QuicTraceLogError("[ tls] Failed to allocate TLS context.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -1116,7 +1116,7 @@ QuicTlsInitialize(
TlsContext->SecConfig = QuicTlsSecConfigAddRef(Config->SecConfig);
TlsContext->ReceiveTPCallback = Config->ReceiveTPCallback;
LogVerbose("[ tls][%p][%c] Created.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogVerbose("[ tls][%p][%c] Created.", TlsContext, GetTlsIdentifier(TlsContext));
if (!Config->IsServer) {
@ -1125,7 +1125,7 @@ QuicTlsInitialize(
ServerNameLength = (uint16_t)strnlen(Config->ServerName, QUIC_MAX_SNI_LENGTH);
if (ServerNameLength == QUIC_MAX_SNI_LENGTH) {
LogError("[ tls][%p][%c] Invalid / Too long server name!", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogError("[ tls][%p][%c] Invalid / Too long server name!", TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Exit;
}
@ -1133,7 +1133,7 @@ QuicTlsInitialize(
TlsContext->SNI = QuicAlloc(ServerNameLength + 1);
if (TlsContext->SNI == NULL) {
LogError("[ tls][%p][%c] Failed to allocate SNI.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogError("[ tls][%p][%c] Failed to allocate SNI.", TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -1148,7 +1148,7 @@ QuicTlsInitialize(
TlsContext->Ssl = SSL_new(Config->SecConfig->SSLCtx);
if (TlsContext->Ssl == NULL) {
LogError("[ tls][%p][%c] Failed to allocate Ssl object.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogError("[ tls][%p][%c] Failed to allocate Ssl object.", TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -1171,7 +1171,7 @@ QuicTlsInitialize(
TlsContext->Ssl,
Config->LocalTPBuffer,
Config->LocalTPLength) != 1) {
LogError("[ tls][%p][%c] Failed to set TP.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogError("[ tls][%p][%c] Failed to set TP.", TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1196,7 +1196,7 @@ QuicTlsUninitialize(
)
{
if (TlsContext != NULL) {
LogVerbose("[ tls][%p][%c] Cleaning up.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogVerbose("[ tls][%p][%c] Cleaning up.", TlsContext, GetTlsIdentifier(TlsContext));
if (TlsContext->SecConfig != NULL) {
QuicTlsSecConfigRelease(TlsContext->SecConfig);
@ -1223,7 +1223,7 @@ QuicTlsReset(
_In_ QUIC_TLS* TlsContext
)
{
LogInfo("[ tls][%p][%c] Resetting TLS state.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogInfo("[ tls][%p][%c] Resetting TLS state.", TlsContext, GetTlsIdentifier(TlsContext));
QUIC_DBG_ASSERT(TlsContext->IsServer == FALSE);
@ -1242,7 +1242,7 @@ QuicTlsReset(
TlsContext->Ssl = SSL_new(TlsContext->SecConfig->SSLCtx);
if (TlsContext->Ssl == NULL) {
LogError("[ tls][%p][%c] Failed to allocate Ssl object.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogError("[ tls][%p][%c] Failed to allocate Ssl object.", TlsContext, GetTlsIdentifier(TlsContext));
QUIC_DBG_ASSERT(FALSE);
goto Exit;
}
@ -1261,7 +1261,7 @@ QuicTlsReset(
TlsContext->Ssl,
Config->LocalTPBuffer,
Config->LocalTPLength) != 1) {
LogError("[ tls][%p][%c] Failed to set TP.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogError("[ tls][%p][%c] Failed to set TP.", TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}*/
@ -1293,7 +1293,7 @@ QuicTlsProcessData(
QUIC_DBG_ASSERT(Buffer != NULL || *BufferLength == 0);
if (*BufferLength != 0) {
LogVerbose("[ tls][%p][%c] Processing %u received bytes.",
QuicTraceLogVerbose("[ tls][%p][%c] Processing %u received bytes.",
TlsContext, GetTlsIdentifier(TlsContext), *BufferLength);
}
@ -1319,20 +1319,20 @@ QuicTlsProcessData(
goto Exit;
case SSL_ERROR_SSL:
LogError("[ tls][%p][%c] TLS handshake error: %s.",
QuicTraceLogError("[ tls][%p][%c] TLS handshake error: %s.",
TlsContext, GetTlsIdentifier(TlsContext), ERR_error_string(ERR_get_error(), NULL));
TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR;
goto Exit;
default:
LogError("[ tls][%p][%c] TLS handshake error: %d.",
QuicTraceLogError("[ tls][%p][%c] TLS handshake error: %d.",
TlsContext, GetTlsIdentifier(TlsContext), Err);
TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR;
goto Exit;
}
}
LogInfo("[ tls][%p][%c] Handshake complete.", TlsContext, GetTlsIdentifier(TlsContext));
QuicTraceLogInfo("[ tls][%p][%c] Handshake complete.", TlsContext, GetTlsIdentifier(TlsContext));
State->HandshakeComplete = TRUE;
TlsContext->ResultFlags |= QUIC_TLS_RESULT_COMPLETE;
@ -1345,7 +1345,7 @@ QuicTlsProcessData(
SSL_get_peer_quic_transport_params(
TlsContext->Ssl, &TransportParams, &TransportParamLen);
if (TransportParams == NULL || TransportParamLen == 0) {
LogError("[ tls][%p][%c] No transport parameters received",
QuicTraceLogError("[ tls][%p][%c] No transport parameters received",
TlsContext, GetTlsIdentifier(TlsContext));
TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR;
goto Exit;
@ -1369,13 +1369,13 @@ QuicTlsProcessData(
goto Exit;
case SSL_ERROR_SSL:
LogError("[ tls][%p][%c] TLS handshake error: %s.",
QuicTraceLogError("[ tls][%p][%c] TLS handshake error: %s.",
TlsContext, GetTlsIdentifier(TlsContext), ERR_error_string(ERR_get_error(), NULL));
TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR;
goto Exit;
default:
LogError("[ tls][%p][%c] TLS handshake error: %d.",
QuicTraceLogError("[ tls][%p][%c] TLS handshake error: %d.",
TlsContext, GetTlsIdentifier(TlsContext), Err);
TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR;
goto Exit;
@ -1467,7 +1467,7 @@ QuicPacketKeyCreateInitial(
Status = QuicAllocatePacketKey(QUIC_PACKET_KEY_INITIAL, TRUE, &TempWriteKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] Key alloc failure.");
QuicTraceLogError("[ tls] Key alloc failure.");
goto Exit;
}
@ -1482,7 +1482,7 @@ QuicPacketKeyCreateInitial(
Salt,
QUIC_VERSION_SALT_LENGTH,
EVP_sha256())) {
LogError("[ tls] QuicTlsHkdfExtract failed.");
QuicTraceLogError("[ tls] QuicTlsHkdfExtract failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1493,7 +1493,7 @@ QuicPacketKeyCreateInitial(
sizeof(Secret),
InitialSecret,
sizeof(InitialSecret))) {
LogError("[ tls] QuicTlsDeriveServerInitialSecret failed.");
QuicTraceLogError("[ tls] QuicTlsDeriveServerInitialSecret failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1503,7 +1503,7 @@ QuicPacketKeyCreateInitial(
sizeof(Secret),
InitialSecret,
sizeof(InitialSecret))) {
LogError("[ tls] QuicTlsDeriveClientInitialSecret failed.");
QuicTraceLogError("[ tls] QuicTlsDeriveClientInitialSecret failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1517,7 +1517,7 @@ QuicPacketKeyCreateInitial(
TempWriteKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionKey failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionKey failed. error: %ld", Status);
goto Exit;
}
@ -1529,7 +1529,7 @@ QuicPacketKeyCreateInitial(
TempWriteKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionIv failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionIv failed. error: %ld", Status);
goto Exit;
}
@ -1541,7 +1541,7 @@ QuicPacketKeyCreateInitial(
TempWriteKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDeriveHeaderProtectionKey failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDeriveHeaderProtectionKey failed. error: %ld", Status);
goto Exit;
}
}
@ -1550,7 +1550,7 @@ QuicPacketKeyCreateInitial(
Status = QuicAllocatePacketKey(QUIC_PACKET_KEY_INITIAL, TRUE, &TempReadKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] Key alloc failure.");
QuicTraceLogError("[ tls] Key alloc failure.");
goto Exit;
}
@ -1565,7 +1565,7 @@ QuicPacketKeyCreateInitial(
Salt,
QUIC_VERSION_SALT_LENGTH,
EVP_sha256())) {
LogError("[ tls] QuicTlsHkdfExtract failed.");
QuicTraceLogError("[ tls] QuicTlsHkdfExtract failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1576,7 +1576,7 @@ QuicPacketKeyCreateInitial(
sizeof(Secret),
InitialSecret,
sizeof(InitialSecret))) {
LogError("[ tls] QuicTlsDeriveClientInitialSecret failed.");
QuicTraceLogError("[ tls] QuicTlsDeriveClientInitialSecret failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1586,7 +1586,7 @@ QuicPacketKeyCreateInitial(
sizeof(Secret),
InitialSecret,
sizeof(InitialSecret))) {
LogError("[ tls] QuicTlsDeriveServerInitialSecret failed.");
QuicTraceLogError("[ tls] QuicTlsDeriveServerInitialSecret failed.");
Status = QUIC_STATUS_TLS_ERROR;
goto Exit;
}
@ -1600,7 +1600,7 @@ QuicPacketKeyCreateInitial(
TempReadKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionKey failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionKey failed. error: %ld", Status);
goto Exit;
}
@ -1612,7 +1612,7 @@ QuicPacketKeyCreateInitial(
TempReadKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionIv failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionIv failed. error: %ld", Status);
goto Exit;
}
@ -1624,7 +1624,7 @@ QuicPacketKeyCreateInitial(
TempReadKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDeriveHeaderProtectionKey failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDeriveHeaderProtectionKey failed. error: %ld", Status);
goto Exit;
}
}
@ -1676,7 +1676,7 @@ QuicPacketKeyUpdate(
Status = QuicAllocatePacketKey(QUIC_PACKET_KEY_1_RTT, FALSE, &TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] Key alloc failure");
QuicTraceLogError("[ tls] Key alloc failure");
goto Exit;
}
@ -1695,7 +1695,7 @@ QuicPacketKeyUpdate(
SecretLen,
QuicTlsKeyGetMd(OldKey->TrafficSecret[0].Hash));
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsUpdateTrafficSecret failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsUpdateTrafficSecret failed. error: %ld", Status);
goto Exit;
}
@ -1706,7 +1706,7 @@ QuicPacketKeyUpdate(
QuicTlsKeyGetMd(OldKey->TrafficSecret[0].Hash),
TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionKey failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionKey failed. error: %ld", Status);
goto Exit;
}
@ -1717,7 +1717,7 @@ QuicPacketKeyUpdate(
QuicTlsKeyGetMd(OldKey->TrafficSecret[0].Hash),
TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionIv failed. error: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionIv failed. error: %ld", Status);
goto Exit;
}
@ -1745,7 +1745,7 @@ QuicKeyCreate(
QUIC_KEY* Key = QuicAlloc(sizeof(QUIC_KEY));
if (Key == NULL) {
LogError("[ tls] Failed to allocate key.");
QuicTraceLogError("[ tls] Failed to allocate key.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -1856,7 +1856,7 @@ QuicHpKeyCreate(
QUIC_HP_KEY* Key = QUIC_ALLOC_NONPAGED(sizeof(QUIC_KEY));
if (Key == NULL) {
LogError("[ tls] Failed to allocate key.");
QuicTraceLogError("[ tls] Failed to allocate key.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -1934,7 +1934,7 @@ QuicHashCreate(
QUIC_HASH* Hash = QUIC_ALLOC_NONPAGED(sizeof(QUIC_HASH) + SaltLength);
if (Hash == NULL) {
LogError("[ tls] Failed to allocate hash.");
QuicTraceLogError("[ tls] Failed to allocate hash.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -2086,7 +2086,7 @@ QuicTlsKeyCreate(
Status = QuicAllocatePacketKey(KeyType, TRUE, &TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] key alloc failed.");
QuicTraceLogError("[ tls] key alloc failed.");
goto Exit;
}
@ -2100,7 +2100,7 @@ QuicTlsKeyCreate(
QuicTlsKeyGetMd(HashType),
TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionKey failed. Status: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionKey failed. Status: %ld", Status);
goto Exit;
}
@ -2111,7 +2111,7 @@ QuicTlsKeyCreate(
QuicTlsKeyGetMd(HashType),
TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDeriveHeaderProtectionKey failed. Status: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDeriveHeaderProtectionKey failed. Status: %ld", Status);
goto Exit;
}
@ -2122,7 +2122,7 @@ QuicTlsKeyCreate(
QuicTlsKeyGetMd(HashType),
TempKey);
if (QUIC_FAILED(Status)) {
LogError("[ tls] QuicTlsDerivePacketProtectionIv failed. Status: %ld", Status);
QuicTraceLogError("[ tls] QuicTlsDerivePacketProtectionIv failed. Status: %ld", Status);
goto Exit;
}
@ -2159,49 +2159,49 @@ QuicTlsHdkfExpand(
EVP_PKEY_CTX *KeyCtx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL);
if (KeyCtx == NULL) {
LogError("[ tls] Key ctx alloc failed");
QuicTraceLogError("[ tls] Key ctx alloc failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_derive_init(KeyCtx) != 1) {
LogError("[ tls] EVP_PKEY_derive_init failed");
QuicTraceLogError("[ tls] EVP_PKEY_derive_init failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_hkdf_mode(KeyCtx, EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) != 1) {
LogError("[ tls] EVP_PKEY_CTX_hkdf_mode failed");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_hkdf_mode failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set_hkdf_md(KeyCtx, Md) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set_hkdf_md failed");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set_hkdf_md failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set1_hkdf_salt(KeyCtx, "", 0) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set1_hkdf_salt failed");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set1_hkdf_salt failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set1_hkdf_key(KeyCtx, Secret, SecretLen) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set1_hkdf_key failed");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set1_hkdf_key failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_add1_hkdf_info(KeyCtx, Info, InfoLen) != 1) {
LogError("[ tls] EVP_PKEY_CTX_add1_hkdf_info failed");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_add1_hkdf_info failed");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_derive(KeyCtx, OutputBuffer, &OutputBufferLen) != 1) {
LogError("[ tls] EVP_PKEY_derive failed");
QuicTraceLogError("[ tls] EVP_PKEY_derive failed");
Ret = FALSE;
goto Exit;
}
@ -2279,7 +2279,7 @@ QuicAllocatePacketKey(
QUIC_PACKET_KEY * TempKey = QuicAlloc(PacketKeyLength);
if (TempKey == NULL) {
LogError("[ tls] TempKey alloc failed.");
QuicTraceLogError("[ tls] TempKey alloc failed.");
goto Error;
}
@ -2289,14 +2289,14 @@ QuicAllocatePacketKey(
if (AllocHpKey) {
TempKey->HeaderKey = QuicAlloc(sizeof(QUIC_HP_KEY));
if (TempKey->HeaderKey == NULL) {
LogError("[ tls] HeaderKey alloc failed.");
QuicTraceLogError("[ tls] HeaderKey alloc failed.");
goto Error;
}
}
TempKey->PacketKey = QuicAlloc(sizeof(QUIC_KEY));
if (TempKey->PacketKey == NULL) {
LogError("[ tls] PacketKey alloc failed.");
QuicTraceLogError("[ tls] PacketKey alloc failed.");
goto Error;
}
@ -2337,7 +2337,7 @@ QuicTlsDerivePacketProtectionKey(
Md);
if (!Ret) {
LogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
QuicTraceLogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
return QUIC_STATUS_TLS_ERROR;
}
@ -2368,7 +2368,7 @@ QuicTlsDerivePacketProtectionIv(
Md);
if (!Ret) {
LogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
QuicTraceLogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
return QUIC_STATUS_TLS_ERROR;
}
@ -2400,7 +2400,7 @@ QuicTlsDeriveHeaderProtectionKey(
Md);
if (!Ret) {
LogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
QuicTraceLogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
return QUIC_STATUS_TLS_ERROR;
}
@ -2428,7 +2428,7 @@ QuicTlsUpdateTrafficSecret(
Md);
if (!Ret) {
LogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
QuicTraceLogError("[ tls] QuicTlsHkdfExpandLabel failed, error: %d", Ret);
return QUIC_STATUS_TLS_ERROR;
}
@ -2489,42 +2489,42 @@ QuicTlsHkdfExtract(
EVP_PKEY_CTX *KeyCtx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL);
if (KeyCtx == NULL) {
LogError("[ tls] EVP_PKEY_CTX_new_id failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_new_id failed.");
return FALSE;
}
if (EVP_PKEY_derive_init(KeyCtx) != 1) {
LogError("[ tls] EVP_PKEY_derive_init failed.");
QuicTraceLogError("[ tls] EVP_PKEY_derive_init failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_hkdf_mode(KeyCtx, EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY) != 1) {
LogError("[ tls] EVP_PKEY_CTX_hkdf_mode failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_hkdf_mode failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set_hkdf_md(KeyCtx, Md) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set_hkdf_md failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set_hkdf_md failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set1_hkdf_salt(KeyCtx, Salt, SaltLen) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set1_hkdf_salt failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set1_hkdf_salt failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set1_hkdf_key(KeyCtx, Secret, SecretLen) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set1_hkdf_key failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set1_hkdf_key failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_derive(KeyCtx, OutputBuffer, &OutputBufferLen) != 1) {
LogError("[ tls] EVP_PKEY_derive failed.");
QuicTraceLogError("[ tls] EVP_PKEY_derive failed.");
Ret = FALSE;
goto Exit;
}
@ -2582,46 +2582,46 @@ QuicTlsEncrypt(
QUIC_FRE_ASSERT(TagLen == QUIC_ENCRYPTION_OVERHEAD);
if (OutputBufferLen < PlainTextLen + TagLen) {
LogError("[ tls] Incorrect output buffer length :%ld.", OutputBufferLen);
QuicTraceLogError("[ tls] Incorrect output buffer length :%ld.", OutputBufferLen);
Ret = -1;
goto Exit;
}
CipherCtx = EVP_CIPHER_CTX_new();
if (CipherCtx == NULL) {
LogError("[ tls] CipherCtx alloc failed.");
QuicTraceLogError("[ tls] CipherCtx alloc failed.");
Ret = -1;
goto Exit;
}
if (EVP_EncryptInit_ex(CipherCtx, Aead, NULL, NULL, NULL) != 1) {
LogError("[ tls] EVP_EncryptInit_ex failed.");
QuicTraceLogError("[ tls] EVP_EncryptInit_ex failed.");
Ret = -1;
goto Exit;
}
if (EVP_CIPHER_CTX_ctrl(CipherCtx, EVP_CTRL_AEAD_SET_IVLEN, NonceLen, NULL) != 1) {
LogError("[ tls] EVP_CIPHER_CTX_ctrl failed.");
QuicTraceLogError("[ tls] EVP_CIPHER_CTX_ctrl failed.");
Ret = -1;
goto Exit;
}
if (EVP_EncryptInit_ex(CipherCtx, NULL, NULL, Key, Nonce) != 1) {
LogError("[ tls] EVP_EncryptInit_ex failed.");
QuicTraceLogError("[ tls] EVP_EncryptInit_ex failed.");
Ret = -1;
goto Exit;
}
if (Authdata != NULL) {
if (EVP_EncryptUpdate(CipherCtx, NULL, &Len, Authdata, AuthDataLen) != 1) {
LogError("[ tls] EVP_EncryptUpdate failed.");
QuicTraceLogError("[ tls] EVP_EncryptUpdate failed.");
Ret = -1;
goto Exit;
}
}
if (EVP_EncryptUpdate(CipherCtx, OutputBuffer, &Len, PlainText, PlainTextLen) != 1) {
LogError("[ tls] EVP_EncryptUpdate failed.");
QuicTraceLogError("[ tls] EVP_EncryptUpdate failed.");
Ret = -1;
goto Exit;
}
@ -2629,7 +2629,7 @@ QuicTlsEncrypt(
OutLen = Len;
if (EVP_EncryptFinal_ex(CipherCtx, OutputBuffer + OutLen, &Len) != 1) {
LogError("[ tls] EVP_EncryptFinal_ex failed.");
QuicTraceLogError("[ tls] EVP_EncryptFinal_ex failed.");
Ret = -1;
goto Exit;
}
@ -2679,7 +2679,7 @@ QuicTlsDecrypt(
QUIC_FRE_ASSERT(TagLen == QUIC_ENCRYPTION_OVERHEAD);
if (TagLen > CipherTextLen || OutputBufferLen + TagLen < CipherTextLen) {
LogError("[ tls] Incorrect buffer length.");
QuicTraceLogError("[ tls] Incorrect buffer length.");
goto Exit;
}
@ -2688,22 +2688,22 @@ QuicTlsDecrypt(
CipherCtx = EVP_CIPHER_CTX_new();
if (CipherCtx == NULL) {
LogError("[ tls] EVP_CIPHER_CTX_new failed.");
QuicTraceLogError("[ tls] EVP_CIPHER_CTX_new failed.");
goto Exit;
}
if (EVP_DecryptInit_ex(CipherCtx, Aead, NULL, NULL, NULL) != 1) {
LogError("[ tls] EVP_DecryptInit_ex failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_DecryptInit_ex failed, 0x%x.", ERR_get_error());
goto Exit;
}
if (EVP_CIPHER_CTX_ctrl(CipherCtx, EVP_CTRL_AEAD_SET_IVLEN, NonceLen, NULL) != 1) {
LogError("[ tls] EVP_CIPHER_CTX_ctrl failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_CIPHER_CTX_ctrl failed, 0x%x.", ERR_get_error());
goto Exit;
}
if (EVP_DecryptInit_ex(CipherCtx, NULL, NULL, Key, Nonce) != 1) {
LogError("[ tls] EVP_DecryptInit_ex failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_DecryptInit_ex failed, 0x%x.", ERR_get_error());
goto Exit;
}
@ -2712,25 +2712,25 @@ QuicTlsDecrypt(
if (AuthData != NULL) {
if (EVP_DecryptUpdate(CipherCtx, NULL, &Len, AuthData, AuthDataLen) != 1) {
LogError("[ tls] EVP_DecryptUpdate (AD) failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_DecryptUpdate (AD) failed, 0x%x.", ERR_get_error());
goto Exit;
}
}
if (EVP_DecryptUpdate(CipherCtx, OutputBuffer, &Len, CipherText, CipherTextLen) != 1) {
LogError("[ tls] EVP_DecryptUpdate (Cipher) failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_DecryptUpdate (Cipher) failed, 0x%x.", ERR_get_error());
goto Exit;
}
OutLen = Len;
if (EVP_CIPHER_CTX_ctrl(CipherCtx, EVP_CTRL_AEAD_SET_TAG, TagLen, Tag) != 1) {
LogError("[ tls] EVP_CIPHER_CTX_ctrl failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_CIPHER_CTX_ctrl failed, 0x%x.", ERR_get_error());
goto Exit;
}
if (EVP_DecryptFinal_ex(CipherCtx, OutputBuffer + OutLen, &Len) != 1) {
LogError("[ tls] EVP_DecryptFinal_ex failed, 0x%x.", ERR_get_error());
QuicTraceLogError("[ tls] EVP_DecryptFinal_ex failed, 0x%x.", ERR_get_error());
goto Exit;
}
@ -2768,17 +2768,17 @@ QuicTlsHeaderMask(
EVP_CIPHER_CTX *CipherCtx = EVP_CIPHER_CTX_new();
if (CipherCtx == NULL) {
LogError("[ tls] Cipherctx alloc failed.");
QuicTraceLogError("[ tls] Cipherctx alloc failed.");
goto Exit;
}
if (EVP_EncryptInit_ex(CipherCtx, Aead, NULL, Key, Cipher) != 1) {
LogError("[ tls] EVP_EncryptInit_ex failed.");
QuicTraceLogError("[ tls] EVP_EncryptInit_ex failed.");
goto Exit;
}
if (EVP_EncryptUpdate(CipherCtx, Temp, &Len, PLAINTEXT, sizeof(PLAINTEXT) - 1) != 1) {
LogError("[ tls] EVP_EncryptUpdate failed.");
QuicTraceLogError("[ tls] EVP_EncryptUpdate failed.");
goto Exit;
}
@ -2786,7 +2786,7 @@ QuicTlsHeaderMask(
OutputLen += Len;
if (EVP_EncryptFinal_ex(CipherCtx, Temp + OutputLen, &Len) != 1) {
LogError("[ tls] EVP_EncryptFinal_ex failed.");
QuicTraceLogError("[ tls] EVP_EncryptFinal_ex failed.");
goto Exit;
}
@ -2820,43 +2820,43 @@ QuicTlsHash(
EVP_PKEY_CTX *KeyCtx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL);
if (KeyCtx == NULL) {
LogError("[ tls] KeyCtx alloc failed.");
QuicTraceLogError("[ tls] KeyCtx alloc failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_derive_init(KeyCtx) != 1) {
LogError("[ tls] EVP_PKEY_derive_init failed.");
QuicTraceLogError("[ tls] EVP_PKEY_derive_init failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_hkdf_mode(KeyCtx, EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) != 1) {
LogError("[ tls] EVP_PKEY_CTX_hkdf_mode failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_hkdf_mode failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set_hkdf_md(KeyCtx, Hash->Md) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set_hkdf_md failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set_hkdf_md failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set1_hkdf_salt(KeyCtx, Salt, SaltLen) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set1_hkdf_salt failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set1_hkdf_salt failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_CTX_set1_hkdf_key(KeyCtx, Secret, SecretLen) != 1) {
LogError("[ tls] EVP_PKEY_CTX_set1_hkdf_key failed.");
QuicTraceLogError("[ tls] EVP_PKEY_CTX_set1_hkdf_key failed.");
Ret = FALSE;
goto Exit;
}
if (EVP_PKEY_derive(KeyCtx, OutputBuffer, &OutputBufferLen) != 1) {
LogError("[ tls] EVP_PKEY_derive failed.");
QuicTraceLogError("[ tls] EVP_PKEY_derive failed.");
Ret = FALSE;
goto Exit;
}

Просмотреть файл

@ -260,7 +260,7 @@ QuicTlsLibraryInitialize(
MS_PRIMITIVE_PROVIDER,
Flags);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Open HMAC_SHA256 algorithm");
QuicTraceEvent(LibraryErrorStatus, Status, "Open HMAC_SHA256 algorithm");
goto Error;
}
@ -271,7 +271,7 @@ QuicTlsLibraryInitialize(
MS_PRIMITIVE_PROVIDER,
Flags);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Open HMAC_SHA384 algorithm");
QuicTraceEvent(LibraryErrorStatus, Status, "Open HMAC_SHA384 algorithm");
goto Error;
}
@ -282,7 +282,7 @@ QuicTlsLibraryInitialize(
MS_PRIMITIVE_PROVIDER,
Flags);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Open HMAC_SHA512 algorithm");
QuicTraceEvent(LibraryErrorStatus, Status, "Open HMAC_SHA512 algorithm");
goto Error;
}
@ -293,7 +293,7 @@ QuicTlsLibraryInitialize(
MS_PRIMITIVE_PROVIDER,
BCRYPT_PROV_DISPATCH);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Open AES algorithm");
QuicTraceEvent(LibraryErrorStatus, Status, "Open AES algorithm");
goto Error;
}
@ -305,7 +305,7 @@ QuicTlsLibraryInitialize(
sizeof(BCRYPT_CHAIN_MODE_ECB),
0);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Set ECB chaining mode");
QuicTraceEvent(LibraryErrorStatus, Status, "Set ECB chaining mode");
goto Error;
}
@ -316,7 +316,7 @@ QuicTlsLibraryInitialize(
MS_PRIMITIVE_PROVIDER,
BCRYPT_PROV_DISPATCH);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Open AES algorithm");
QuicTraceEvent(LibraryErrorStatus, Status, "Open AES algorithm");
goto Error;
}
@ -328,11 +328,11 @@ QuicTlsLibraryInitialize(
sizeof(BCRYPT_CHAIN_MODE_GCM),
0);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Set GCM chaining mode");
QuicTraceEvent(LibraryErrorStatus, Status, "Set GCM chaining mode");
goto Error;
}
LogVerbose("[ tls] Library initialized");
QuicTraceLogVerbose("[ tls] Library initialized");
Error:
@ -361,7 +361,7 @@ Error:
return NtStatusToQuicStatus(Status);
#else
LogVerbose("[ tls] Library initialized");
QuicTraceLogVerbose("[ tls] Library initialized");
return QUIC_STATUS_SUCCESS;
#endif
}
@ -383,7 +383,7 @@ QuicTlsLibraryUninitialize(
QUIC_AES_ECB_ALG_HANDLE = NULL;
QUIC_AES_GCM_ALG_HANDLE = NULL;
#endif
LogVerbose("[ tls] Library Uninitialized");
QuicTraceLogVerbose("[ tls] Library Uninitialized");
}
#ifndef _KERNEL_MODE
@ -408,14 +408,14 @@ QuicTlsUtf8ToWideChar(
0);
if (Size == 0) {
Error = GetLastError();
EventWriteQuicLibraryErrorStatus(Error, "Get wchar string size");
QuicTraceEvent(LibraryErrorStatus, Error, "Get wchar string size");
goto Error;
}
Buffer = QUIC_ALLOC_NONPAGED(sizeof(WCHAR) * Size);
if (Buffer == NULL) {
Error = ERROR_NOT_ENOUGH_MEMORY;
EventWriteQuicAllocFailure("wchar string", sizeof(WCHAR) * Size);
QuicTraceEvent(AllocFailure, "wchar string", sizeof(WCHAR) * Size);
goto Error;
}
@ -429,7 +429,7 @@ QuicTlsUtf8ToWideChar(
Size);
if (Size == 0) {
Error = GetLastError();
EventWriteQuicLibraryErrorStatus(Error, "Convert string to wchar");
QuicTraceEvent(LibraryErrorStatus, Error, "Convert string to wchar");
goto Error;
}
@ -477,13 +477,13 @@ QuicTlsUtf8ToUnicodeString(
Input,
(ULONG) InputLength);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Get unicode string size");
QuicTraceEvent(LibraryErrorStatus, Status, "Get unicode string size");
goto Error;
}
UnicodeString = QUIC_ALLOC_NONPAGED(RequiredSize);
if (UnicodeString == NULL) {
EventWriteQuicAllocFailure("unicode string", RequiredSize);
QuicTraceEvent(AllocFailure, "unicode string", RequiredSize);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -496,7 +496,7 @@ QuicTlsUtf8ToUnicodeString(
Input,
(ULONG) InputLength);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Convert string to unicode");
QuicTraceEvent(LibraryErrorStatus, Status, "Convert string to unicode");
goto Error;
}
@ -528,7 +528,7 @@ QuicTlsAllocateAchaContext(
QUIC_ACHA_CONTEXT* NewAchaContext = QUIC_ALLOC_NONPAGED(sizeof(QUIC_ACHA_CONTEXT));
if (NewAchaContext == NULL) {
EventWriteQuicAllocFailure("QUIC_ACHA_CONTEXT", sizeof(QUIC_ACHA_CONTEXT));
QuicTraceEvent(AllocFailure, "QUIC_ACHA_CONTEXT", sizeof(QUIC_ACHA_CONTEXT));
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -560,7 +560,7 @@ QuicTlsSspiNotifyCallback(
)
{
if (CallbackData == NULL) {
EventWriteQuicLibraryError("NULL CallbackData to QuicTlsSspiNotifyCallback");
QuicTraceEvent(LibraryError, "NULL CallbackData to QuicTlsSspiNotifyCallback");
return;
}
QUIC_ACHA_CONTEXT* Context = CallbackData;
@ -570,7 +570,7 @@ QuicTlsSspiNotifyCallback(
SECURITY_STATUS Status = SspiGetAsyncCallStatus(Handle);
QuicTlsFreeAchaContext(Context);
if (Status != SEC_E_OK) {
EventWriteQuicLibraryErrorStatus(Status, "Completion for SspiAcquireCredentialsHandleAsyncW");
QuicTraceEvent(LibraryErrorStatus, Status, "Completion for SspiAcquireCredentialsHandleAsyncW");
CompletionCallback(CompletionContext, SecStatusToQuicStatus(Status), NULL);
QuicTlsSecConfigRelease(SecConfig); // *MUST* be last call to prevent crash in platform cleanup.
} else {
@ -645,7 +645,7 @@ QuicTlsServerSecConfigCreate(
QUIC_DBG_ASSERT(Rundown != NULL);
if (!QuicRundownAcquire(Rundown)) {
EventWriteQuicLibraryError("Acquire SecConfig rundown");
QuicTraceEvent(LibraryError, "Acquire SecConfig rundown");
return QUIC_STATUS_INVALID_STATE;
}
@ -653,7 +653,7 @@ QuicTlsServerSecConfigCreate(
QUIC_SERVER_SEC_CONFIG* Config = QUIC_ALLOC_NONPAGED(sizeof(QUIC_SERVER_SEC_CONFIG));
if (Config == NULL) {
QuicRundownRelease(Rundown);
EventWriteQuicAllocFailure("QUIC_SERVER_SEC_CONFIG", sizeof(QUIC_SERVER_SEC_CONFIG));
QuicTraceEvent(AllocFailure, "QUIC_SERVER_SEC_CONFIG", sizeof(QUIC_SERVER_SEC_CONFIG));
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -701,7 +701,7 @@ QuicTlsServerSecConfigCreate(
Config->SspiContext = SspiCreateAsyncContext();
if (Config->SspiContext == NULL) {
EventWriteQuicLibraryError("SspiCreateAsyncContext");
QuicTraceEvent(LibraryError, "SspiCreateAsyncContext");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -712,7 +712,7 @@ QuicTlsServerSecConfigCreate(
QuicTlsSspiNotifyCallback,
AchaContext);
if (SecStatus != SEC_E_OK) {
EventWriteQuicLibraryErrorStatus(SecStatus, "SspiSetAsyncNotifyCallback");
QuicTraceEvent(LibraryErrorStatus, SecStatus, "SspiSetAsyncNotifyCallback");
Status = SecStatusToQuicStatus(SecStatus);
goto Error;
}
@ -763,7 +763,7 @@ QuicTlsServerSecConfigCreate(
CertHashStore->StoreName,
sizeof(CertHashStore->StoreName)));
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Convert cert store name to unicode");
QuicTraceEvent(LibraryErrorStatus, Status, "Convert cert store name to unicode");
goto Error;
}
@ -780,7 +780,7 @@ QuicTlsServerSecConfigCreate(
Credentials->paCred = NULL;
} else {
Status = QUIC_STATUS_INVALID_PARAMETER;
EventWriteQuicLibraryError("Invalid flags passed in to QuicTlsSecConfigCreate");
QuicTraceEvent(LibraryError, "Invalid flags passed in to QuicTlsSecConfigCreate");
goto Error;
}
@ -788,7 +788,7 @@ QuicTlsServerSecConfigCreate(
Status = QuicTlsUtf8ToUnicodeString(Principal, &AchaContext->Principal);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "Convert principal to unicode");
QuicTraceEvent(LibraryErrorStatus, Status, "Convert principal to unicode");
goto Error;
}
@ -808,7 +808,7 @@ QuicTlsServerSecConfigCreate(
&Config->CertificateHandle,
NULL);
if (SecStatus != SEC_E_OK) {
EventWriteQuicLibraryErrorStatus(SecStatus, "SspiAcquireCredentialsHandleAsyncW");
QuicTraceEvent(LibraryErrorStatus, SecStatus, "SspiAcquireCredentialsHandleAsyncW");
Status = SecStatusToQuicStatus(SecStatus);
goto Error;
}
@ -833,7 +833,7 @@ QuicTlsServerSecConfigCreate(
Principal,
&CertContext);
if (QUIC_FAILED(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "QuicCertCreate");
QuicTraceEvent(LibraryErrorStatus, Status, "QuicCertCreate");
goto Error;
}
}
@ -841,7 +841,7 @@ QuicTlsServerSecConfigCreate(
Credentials->cCreds = 1;
Credentials->paCred = &CertContext;
LogVerbose("[ tls] Calling ACH to create server security config");
QuicTraceLogVerbose("[ tls] Calling ACH to create server security config");
SecStatus =
AcquireCredentialsHandleW(
@ -855,7 +855,7 @@ QuicTlsServerSecConfigCreate(
&Config->CertificateHandle,
&CredExpiration);
if (SecStatus != SEC_E_OK) {
EventWriteQuicLibraryErrorStatus(SecStatus, "AcquireCredentialsHandleW");
QuicTraceEvent(LibraryErrorStatus, SecStatus, "AcquireCredentialsHandleW");
Status = SecStatusToQuicStatus(SecStatus);
goto Error;
}
@ -863,7 +863,7 @@ QuicTlsServerSecConfigCreate(
//
// In user mode, call the completion in-line.
//
LogVerbose("[ tls] Invoking security config completion callback, 0x%x", SecStatus);
QuicTraceLogVerbose("[ tls] Invoking security config completion callback, 0x%x", SecStatus);
CompletionHandler(Context, SecStatusToQuicStatus(SecStatus), (QUIC_SEC_CONFIG*)Config);
Status = QUIC_STATUS_PENDING;
#endif
@ -927,7 +927,7 @@ QuicTlsClientSecConfigCreate(
QUIC_CLIENT_SEC_CONFIG* Config = QUIC_ALLOC_PAGED(sizeof(QUIC_CLIENT_SEC_CONFIG));
if (Config == NULL) {
EventWriteQuicAllocFailure("QUIC_CLIENT_SEC_CONFIG", sizeof(QUIC_CLIENT_SEC_CONFIG));
QuicTraceEvent(AllocFailure, "QUIC_CLIENT_SEC_CONFIG", sizeof(QUIC_CLIENT_SEC_CONFIG));
return QUIC_STATUS_OUT_OF_MEMORY;
}
@ -967,7 +967,7 @@ QuicTlsClientSecConfigCreate(
&Config->SchannelHandle,
&CredExpiration);
if (SecStatus != SEC_E_OK) {
EventWriteQuicLibraryErrorStatus(SecStatus, "AcquireCredentialsHandleW");
QuicTraceEvent(LibraryErrorStatus, SecStatus, "AcquireCredentialsHandleW");
Status = SecStatusToQuicStatus(SecStatus);
QUIC_DBG_ASSERT(QUIC_FAILED(Status));
goto Error;
@ -1029,7 +1029,7 @@ QuicTlsSessionInitialize(
QUIC_TLS_SESSION* TlsSession =
QUIC_ALLOC_NONPAGED(sizeof(QUIC_TLS_SESSION) + AppProtocolsSize);
if (TlsSession == NULL) {
EventWriteQuicAllocFailure("QUIC_TLS_SESSION", sizeof(QUIC_TLS_SESSION) + AppProtocolsSize);
QuicTraceEvent(AllocFailure, "QUIC_TLS_SESSION", sizeof(QUIC_TLS_SESSION) + AppProtocolsSize);
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -1114,7 +1114,7 @@ QuicTlsInitialize(
QUIC_STATUS Status = QUIC_STATUS_SUCCESS;
QUIC_TLS* TlsContext = QUIC_ALLOC_NONPAGED(sizeof(QUIC_TLS));
if (TlsContext == NULL) {
EventWriteQuicAllocFailure("QUIC_TLS", sizeof(QUIC_TLS));
QuicTraceEvent(AllocFailure, "QUIC_TLS", sizeof(QUIC_TLS));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -1125,7 +1125,7 @@ QuicTlsInitialize(
TlsContext->IsServer = Config->IsServer;
TlsContext->TlsSession = Config->TlsSession;
LogVerbose("[ tls][%p][%c] Created.",
QuicTraceLogVerbose("[ tls][%p][%c] Created.",
TlsContext, GetTlsIdentifier(TlsContext));
TlsContext->TransportParams = (SEND_GENERIC_TLS_EXTENSION*)Config->LocalTPBuffer;
@ -1194,7 +1194,7 @@ QuicTlsUninitialize(
)
{
if (TlsContext != NULL) {
LogVerbose("[ tls][%p][%c] Cleaning up.",
QuicTraceLogVerbose("[ tls][%p][%c] Cleaning up.",
TlsContext, GetTlsIdentifier(TlsContext));
QuicTlsResetSchannel(TlsContext);
@ -1214,7 +1214,7 @@ QuicTlsReset(
_In_ QUIC_TLS* TlsContext
)
{
LogInfo("[ tls][%p][%c] Resetting TLS state.",
QuicTraceLogInfo("[ tls][%p][%c] Resetting TLS state.",
TlsContext, GetTlsIdentifier(TlsContext));
//
@ -1262,6 +1262,8 @@ QuicTlsWriteDataToSchannel(
OutSecBufferDesc.pBuffers = OutSecBuffers;
OutSecBufferDesc.cBuffers = 0;
uint8_t AlertBufferRaw[2];
if (*InBufferLength == 0) {
//
@ -1278,7 +1280,7 @@ QuicTlsWriteDataToSchannel(
QUIC_STATUS Status = QuicTlsUtf8ToWideChar(TlsContext->SNI, &TargetServerName);
#endif
if (QUIC_FAILED(Status)) {
EventWriteQuicTlsErrorStatus(TlsContext->Connection, Status, "Convert SNI to unicode");
QuicTraceEvent(TlsErrorStatus, TlsContext->Connection, Status, "Convert SNI to unicode");
return QUIC_TLS_RESULT_ERROR;
}
}
@ -1356,8 +1358,8 @@ QuicTlsWriteDataToSchannel(
// Another (output) secbuffer is for any TLS alerts.
//
OutSecBuffers[OutSecBufferDesc.cBuffers].BufferType = SECBUFFER_EMPTY;
OutSecBuffers[OutSecBufferDesc.cBuffers].cbBuffer = 0;
OutSecBuffers[OutSecBufferDesc.cBuffers].pvBuffer = NULL;
OutSecBuffers[OutSecBufferDesc.cBuffers].cbBuffer = sizeof(AlertBufferRaw);
OutSecBuffers[OutSecBufferDesc.cBuffers].pvBuffer = &AlertBufferRaw;
OutSecBufferDesc.cBuffers++;
if (TlsContext->TransportParams != NULL) {
@ -1492,7 +1494,7 @@ QuicTlsWriteDataToSchannel(
if (TrafficSecret->TrafficSecretType == SecTrafficSecret_None) {
continue;
}
LogVerbose("[ tls][%p][%c] Key Ready Type, %u [%hu to %hu].",
QuicTraceLogVerbose("[ tls][%p][%c] Key Ready Type, %u [%hu to %hu].",
TlsContext, GetTlsIdentifier(TlsContext), TrafficSecret->TrafficSecretType,
TrafficSecret->MsgSequenceStart, TrafficSecret->MsgSequenceEnd);
if (TlsContext->IsServer) {
@ -1519,7 +1521,7 @@ QuicTlsWriteDataToSchannel(
// that needs to be sent back in response (depending on client/server).
//
if (!TlsContext->PeerTransportParamsReceived) {
EventWriteQuicTlsError(TlsContext->Connection, "No QUIC TP received");
QuicTraceEvent(TlsError, TlsContext->Connection, "No QUIC TP received");
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
@ -1542,13 +1544,13 @@ QuicTlsWriteDataToSchannel(
SECPKG_ATTR_APPLICATION_PROTOCOL,
&NegotiatedAlpn);
if (SecStatus != SEC_E_OK) {
EventWriteQuicTlsErrorStatus(TlsContext->Connection, SecStatus, "query negotiated ALPN");
QuicTraceEvent(TlsErrorStatus, TlsContext->Connection, SecStatus, "query negotiated ALPN");
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
if (NegotiatedAlpn.ProtoNegoStatus != SecApplicationProtocolNegotiationStatus_Success) {
EventWriteQuicTlsError(TlsContext->Connection, "ALPN negotiation status");
LogError("[ tls][%p] Failed to negotiate ALPN successfully: %d",
QuicTraceEvent(TlsError, TlsContext->Connection, "ALPN negotiation status");
QuicTraceLogError("[ tls][%p] Failed to negotiate ALPN successfully: %d",
TlsContext, NegotiatedAlpn.ProtoNegoStatus);
Result |= QUIC_TLS_RESULT_ERROR;
break;
@ -1564,7 +1566,7 @@ QuicTlsWriteDataToSchannel(
SECPKG_ATTR_SESSION_INFO,
&SessionInfo);
if (SecStatus != SEC_E_OK) {
EventWriteQuicTlsErrorStatus(TlsContext->Connection, SecStatus, "query session info");
QuicTraceEvent(TlsErrorStatus, TlsContext->Connection, SecStatus, "query session info");
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
@ -1572,7 +1574,7 @@ QuicTlsWriteDataToSchannel(
State->SessionResumed = TRUE;
}
LogInfo("[ tls][%p][%c] Handshake complete (resume=%hu).",
QuicTraceLogInfo("[ tls][%p][%c] Handshake complete (resume=%hu).",
TlsContext, GetTlsIdentifier(TlsContext), State->SessionResumed);
State->HandshakeComplete = TRUE;
Result |= QUIC_TLS_RESULT_COMPLETE;
@ -1584,11 +1586,12 @@ QuicTlsWriteDataToSchannel(
case SEC_I_CONTINUE_NEEDED_MESSAGE_OK:
if (AlertBuffer != NULL) {
//
// TODO: This needs to be indicated in a QUIC CONNECTION_CLOSE frame.
//
LogWarning("[ tls][%p][%c] TLS ALERT message is available!",
TlsContext, GetTlsIdentifier(TlsContext));
if (AlertBuffer->cbBuffer < 2) {
QuicTraceEvent(TlsError, TlsContext->Connection, "TLS alert message received (invalid)");
} else {
State->AlertCode = ((uint8_t*)AlertBuffer->pvBuffer)[1];
QuicTraceEvent(TlsErrorStatus, TlsContext->Connection, State->AlertCode, "TLS alert message received");
}
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
@ -1606,7 +1609,7 @@ QuicTlsWriteDataToSchannel(
*InBufferLength -= InSecBuffers[1].cbBuffer;
}
LogInfo("[ tls][%p][%c] Consumed %u bytes.",
QuicTraceLogInfo("[ tls][%p][%c] Consumed %u bytes.",
TlsContext, GetTlsIdentifier(TlsContext), *InBufferLength);
//
@ -1628,7 +1631,7 @@ QuicTlsWriteDataToSchannel(
break;
}
State->ReadKey = QUIC_PACKET_KEY_HANDSHAKE;
LogInfo("[ tls][%p][%c] Reading Handshake data starts now.",
QuicTraceLogInfo("[ tls][%p][%c] Reading Handshake data starts now.",
TlsContext, GetTlsIdentifier(TlsContext));
} else if (State->ReadKey == QUIC_PACKET_KEY_HANDSHAKE) {
if (!QuicPacketKeyCreate(
@ -1641,7 +1644,7 @@ QuicTlsWriteDataToSchannel(
break;
}
State->ReadKey = QUIC_PACKET_KEY_1_RTT;
LogInfo("[ tls][%p][%c] Reading 1-RTT data starts now.",
QuicTraceLogInfo("[ tls][%p][%c] Reading 1-RTT data starts now.",
TlsContext, GetTlsIdentifier(TlsContext));
}
}
@ -1670,7 +1673,7 @@ QuicTlsWriteDataToSchannel(
State->BufferOffset1Rtt = // HACK - Currently Schannel has weird output for 1-RTT start
State->BufferTotalLength + NewOwnTrafficSecrets[i]->MsgSequenceEnd;
State->WriteKey = QUIC_PACKET_KEY_HANDSHAKE;
LogInfo("[ tls][%p][%c] Writing Handshake data starts at %u.",
QuicTraceLogInfo("[ tls][%p][%c] Writing Handshake data starts at %u.",
TlsContext, GetTlsIdentifier(TlsContext), State->BufferOffsetHandshake);
} else if (State->WriteKey == QUIC_PACKET_KEY_HANDSHAKE) {
if (!TlsContext->IsServer && State->BufferOffsetHandshake == State->BufferOffset1Rtt) {
@ -1689,7 +1692,7 @@ QuicTlsWriteDataToSchannel(
//State->BufferOffset1Rtt = // Currently have to get the offset from the Handshake "end"
// State->BufferTotalLength + NewOwnTrafficSecrets[i]->MsgSequenceStart;
State->WriteKey = QUIC_PACKET_KEY_1_RTT;
LogInfo("[ tls][%p][%c] Writing 1-RTT data starts at %u.",
QuicTraceLogInfo("[ tls][%p][%c] Writing 1-RTT data starts at %u.",
TlsContext, GetTlsIdentifier(TlsContext), State->BufferOffset1Rtt);
}
}
@ -1708,7 +1711,7 @@ QuicTlsWriteDataToSchannel(
State->BufferLength += (uint16_t)OutputTokenBuffer->cbBuffer;
State->BufferTotalLength += OutputTokenBuffer->cbBuffer;
LogInfo("[ tls][%p][%c] Produced %u bytes.",
QuicTraceLogInfo("[ tls][%p][%c] Produced %u bytes.",
TlsContext, GetTlsIdentifier(TlsContext), OutputTokenBuffer->cbBuffer);
}
@ -1717,7 +1720,7 @@ QuicTlsWriteDataToSchannel(
case SEC_I_GENERIC_EXTENSION_RECEIVED:
if (TlsExtensionBuffer == NULL) {
EventWriteQuicTlsError(TlsContext->Connection, "QUIC TP wasn't present");
QuicTraceEvent(TlsError, TlsContext->Connection, "QUIC TP wasn't present");
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
@ -1730,7 +1733,7 @@ QuicTlsWriteDataToSchannel(
TlsContext->Connection,
(uint16_t)(TlsExtensionBuffer->cbBuffer - 4),
((uint8_t*)TlsExtensionBuffer->pvBuffer) + 4)) {
EventWriteQuicTlsError(TlsContext->Connection, "Process QUIC TP");
QuicTraceEvent(TlsError, TlsContext->Connection, "Process QUIC TP");
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
@ -1750,7 +1753,7 @@ QuicTlsWriteDataToSchannel(
*InBufferLength = 0;
if (MissingBuffer != NULL && MissingBuffer->cbBuffer != 0) {
LogInfo("[ tls][%p][%c] TLS message missing %u bytes of data.",
QuicTraceLogInfo("[ tls][%p][%c] TLS message missing %u bytes of data.",
TlsContext, GetTlsIdentifier(TlsContext), MissingBuffer->cbBuffer);
}
@ -1762,7 +1765,7 @@ QuicTlsWriteDataToSchannel(
// processed successfully.
//
*InBufferLength = 0;
EventWriteQuicTlsErrorStatus(TlsContext->Connection, SecStatus, "Accept/InitializeSecurityContext");
QuicTraceEvent(TlsErrorStatus, TlsContext->Connection, SecStatus, "Accept/InitializeSecurityContext");
Result |= QUIC_TLS_RESULT_ERROR;
break;
}
@ -1793,7 +1796,7 @@ QuicTlsProcessData(
{
QUIC_TLS_RESULT_FLAGS Result = 0;
LogVerbose("[ tls][%p][%c] Processing %u received bytes.",
QuicTraceLogVerbose("[ tls][%p][%c] Processing %u received bytes.",
TlsContext, GetTlsIdentifier(TlsContext), *BufferLength);
Result =
@ -1933,7 +1936,7 @@ QuicTlsLogSecret(
SecretStr[i*2] = HEX_TO_CHAR(Secret[i] >> 4);
SecretStr[i*2 + 1] = HEX_TO_CHAR(Secret[i] & 0xf);
}
LogVerbose("[ tls] %s[%u]: %s", Prefix, Length, SecretStr);
QuicTraceLogVerbose("[ tls] %s[%u]: %s", Prefix, Length, SecretStr);
}
#else
#define QuicTlsLogSecret(Prefix, Secret, Length) UNREFERENCED_PARAMETER(Prefix);
@ -2114,7 +2117,7 @@ QuicPacketKeyDerive(
(KeyType == QUIC_PACKET_KEY_1_RTT ? sizeof(QUIC_SECRET) : 0);
QUIC_PACKET_KEY *Key = QUIC_ALLOC_NONPAGED(PacketKeyLength);
if (Key == NULL) {
LogWarning("[ tls] Failed to allocate packet key.");
QuicTraceLogWarning("[ tls] Failed to allocate packet key.");
return QUIC_STATUS_OUT_OF_MEMORY;
}
QuicZeroMemory(Key, sizeof(QUIC_PACKET_KEY));
@ -2296,12 +2299,12 @@ QuicParseTrafficSecrets(
)
{
if (wcscmp(TrafficSecrets->SymmetricAlgId, BCRYPT_AES_ALGORITHM) != 0) {
EventWriteQuicTlsError(TlsContext->Connection, "Unsupported symmetric algorithm");
QuicTraceEvent(TlsError, TlsContext->Connection, "Unsupported symmetric algorithm");
return FALSE;
}
if (wcscmp(TrafficSecrets->ChainingMode, BCRYPT_CHAIN_MODE_GCM) != 0) {
EventWriteQuicTlsError(TlsContext->Connection, "Unsupported chaining mode");
QuicTraceEvent(TlsError, TlsContext->Connection, "Unsupported chaining mode");
return FALSE;
}
@ -2313,7 +2316,7 @@ QuicParseTrafficSecrets(
Secret->Aead = QUIC_AEAD_AES_256_GCM;
break;
default:
EventWriteQuicTlsError(TlsContext->Connection, "Unsupported key size");
QuicTraceEvent(TlsError, TlsContext->Connection, "Unsupported key size");
return FALSE;
}
@ -2324,7 +2327,7 @@ QuicParseTrafficSecrets(
} else if (wcscmp(TrafficSecrets->HashAlgId, BCRYPT_SHA512_ALGORITHM) == 0) {
Secret->Hash = QUIC_HASH_SHA512;
} else {
EventWriteQuicTlsError(TlsContext->Connection, "Unsupported hash algorithm");
QuicTraceEvent(TlsError, TlsContext->Connection, "Unsupported hash algorithm");
return FALSE;
}
@ -2362,7 +2365,7 @@ QuicPacketKeyCreate(
TRUE,
Key);
if (!NT_SUCCESS(Status)) {
EventWriteQuicTlsErrorStatus(TlsContext->Connection, Status, "QuicPacketKeyDerive");
QuicTraceEvent(TlsErrorStatus, TlsContext->Connection, Status, "QuicPacketKeyDerive");
goto Error;
}
@ -2483,7 +2486,7 @@ QuicKeyCreate(
KeyLength,
0);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "BCryptGenerateSymmetricKey");
QuicTraceEvent(LibraryErrorStatus, Status, "BCryptGenerateSymmetricKey");
goto Error;
}
@ -2643,7 +2646,7 @@ QuicHpKeyCreate(
KeyLength,
0);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "BCryptGenerateSymmetricKey (ECB)");
QuicTraceEvent(LibraryErrorStatus, Status, "BCryptGenerateSymmetricKey (ECB)");
goto Error;
}
@ -2729,7 +2732,7 @@ QuicHashCreate(
(ULONG)SaltLength,
BCRYPT_HASH_REUSABLE_FLAG);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "BCryptCreateHash");
QuicTraceEvent(LibraryErrorStatus, Status, "BCryptCreateHash");
goto Error;
}
@ -2770,7 +2773,7 @@ QuicHashCompute(
InputLength,
0);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "BCryptHashData");
QuicTraceEvent(LibraryErrorStatus, Status, "BCryptHashData");
goto Error;
}
@ -2781,7 +2784,7 @@ QuicHashCompute(
OutputLength,
0);
if (!NT_SUCCESS(Status)) {
EventWriteQuicLibraryErrorStatus(Status, "BCryptFinishHash");
QuicTraceEvent(LibraryErrorStatus, Status, "BCryptFinishHash");
goto Error;
}

Просмотреть файл

@ -276,7 +276,7 @@ QuicTlsServerSecConfigCreate(
QUIC_SEC_CONFIG* SecurityConfig = NULL;
if (!QuicRundownAcquire(Rundown)) {
LogError("[ tls] Failed to acquire sec config rundown.");
QuicTraceLogError("[ tls] Failed to acquire sec config rundown.");
Status = QUIC_STATUS_INVALID_STATE;
goto Error;
}
@ -423,7 +423,7 @@ QuicTlsSessionInitialize(
TlsSession = QUIC_ALLOC_PAGED(sizeof(QUIC_TLS_SESSION) + ALPNLength);
if (TlsSession == NULL) {
LogWarning("[ tls] Failed to allocate QUIC_TLS_SESSION.");
QuicTraceLogWarning("[ tls] Failed to allocate QUIC_TLS_SESSION.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
}
@ -501,7 +501,7 @@ QuicTlsInitialize(
QUIC_TLS* TlsContext = QUIC_ALLOC_PAGED(sizeof(QUIC_TLS));
if (TlsContext == NULL) {
LogWarning("[ tls] Failed to allocate QUIC_TLS.");
QuicTraceLogWarning("[ tls] Failed to allocate QUIC_TLS.");
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Exit;
}
@ -516,14 +516,14 @@ QuicTlsInitialize(
TlsContext->Connection = Config->Connection;
TlsContext->ReceiveTPCallback = Config->ReceiveTPCallback;
LogVerbose("[ tls][%p][%c] Created.",
QuicTraceLogVerbose("[ tls][%p][%c] Created.",
TlsContext, GetTlsIdentifier(TlsContext));
if (Config->ServerName != NULL) {
const size_t ServerNameLength =
strnlen(Config->ServerName, QUIC_MAX_SNI_LENGTH + 1);
if (ServerNameLength == QUIC_MAX_SNI_LENGTH + 1) {
LogError("[ tls][%p][%c] Invalid / Too long server name!",
QuicTraceLogError("[ tls][%p][%c] Invalid / Too long server name!",
TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Error;
@ -531,7 +531,7 @@ QuicTlsInitialize(
TlsContext->SNI = QUIC_ALLOC_PAGED(ServerNameLength + 1);
if (TlsContext->SNI == NULL) {
LogWarning("[ tls][%p][%c] Failed to allocate SNI.",
QuicTraceLogWarning("[ tls][%p][%c] Failed to allocate SNI.",
TlsContext, GetTlsIdentifier(TlsContext));
Status = QUIC_STATUS_OUT_OF_MEMORY;
goto Error;
@ -564,7 +564,7 @@ QuicTlsUninitialize(
)
{
if (TlsContext != NULL) {
LogVerbose("[ tls][%p][%c] Cleaning up.",
QuicTraceLogVerbose("[ tls][%p][%c] Cleaning up.",
TlsContext, GetTlsIdentifier(TlsContext));
if (TlsContext->SecConfig != NULL) {
@ -589,7 +589,7 @@ QuicTlsReset(
_In_ QUIC_TLS* TlsContext
)
{
LogInfo("[ tls][%p][%c] Resetting TLS state.",
QuicTraceLogInfo("[ tls][%p][%c] Resetting TLS state.",
TlsContext, GetTlsIdentifier(TlsContext));
QUIC_DBG_ASSERT(TlsContext->IsServer == FALSE);
@ -695,7 +695,7 @@ QuicTlsServerProcess(
&SignAlgo,
1,
&SelectedSignAlgo)) {
LogError("[ tls][%p][%c] No matching signature algorithm for the provided server certificate.",
QuicTraceLogError("[ tls][%p][%c] No matching signature algorithm for the provided server certificate.",
TlsContext, GetTlsIdentifier(TlsContext));
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -766,7 +766,7 @@ QuicTlsServerProcess(
if (ClientMessage->Type == QUIC_TLS_MESSAGE_CLIENT_HANDSHAKE) {
if (ClientMessage->CLIENT_HANDSHAKE.Success == FALSE) {
LogError("[ tls][%p][%c] Failure client finish.",
QuicTraceLogError("[ tls][%p][%c] Failure client finish.",
TlsContext, GetTlsIdentifier(TlsContext));
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -774,7 +774,7 @@ QuicTlsServerProcess(
*ResultFlags |= QUIC_TLS_RESULT_COMPLETE;
LogInfo("[ tls][%p][%c] Handshake complete.",
QuicTraceLogInfo("[ tls][%p][%c] Handshake complete.",
TlsContext, GetTlsIdentifier(TlsContext));
QuicTlsSecConfigRelease(TlsContext->SecConfig);
@ -801,7 +801,7 @@ QuicTlsServerProcess(
TlsContext->LastMessageType = QUIC_TLS_MESSAGE_TICKET;
} else {
LogError("[ tls][%p][%c] Invalid message, %u.",
QuicTraceLogError("[ tls][%p][%c] Invalid message, %u.",
TlsContext, GetTlsIdentifier(TlsContext), ClientMessage->Type);
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -813,7 +813,7 @@ QuicTlsServerProcess(
}
default: {
LogError("[ tls][%p][%c] Invalid last message, %u.",
QuicTraceLogError("[ tls][%p][%c] Invalid last message, %u.",
TlsContext, GetTlsIdentifier(TlsContext), TlsContext->LastMessageType);
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -953,7 +953,7 @@ QuicTlsClientProcess(
QuicTP);
if (TlsContext->SecConfig->Flags & QUIC_CERTIFICATE_FLAG_DISABLE_CERT_VALIDATION) {
LogWarning("[ tls][%p][%c] Certificate validation disabled!",
QuicTraceLogWarning("[ tls][%p][%c] Certificate validation disabled!",
TlsContext, GetTlsIdentifier(TlsContext));
} else {
@ -963,7 +963,7 @@ QuicTlsClientProcess(
ServerMessage->SERVER_HANDSHAKE.Certificate);
if (ServerCert == NULL) {
LogError("[ tls][%p][%c] Cert parse error.",
QuicTraceLogError("[ tls][%p][%c] Cert parse error.",
TlsContext, GetTlsIdentifier(TlsContext));
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -973,7 +973,7 @@ QuicTlsClientProcess(
ServerCert,
TlsContext->SNI,
TlsContext->SecConfig->Flags)) {
LogError("[ tls][%p][%c] Cert chain validation failed.",
QuicTraceLogError("[ tls][%p][%c] Cert chain validation failed.",
TlsContext, GetTlsIdentifier(TlsContext));
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -983,7 +983,7 @@ QuicTlsClientProcess(
State->HandshakeComplete = TRUE;
*ResultFlags |= QUIC_TLS_RESULT_COMPLETE;
LogInfo("[ tls][%p][%c] Handshake complete.",
QuicTraceLogInfo("[ tls][%p][%c] Handshake complete.",
TlsContext, GetTlsIdentifier(TlsContext));
if (MaxClientMessageLength < MinMessageLengths[QUIC_TLS_MESSAGE_CLIENT_HANDSHAKE]) {
@ -1012,7 +1012,7 @@ QuicTlsClientProcess(
TlsContext->LastMessageType = QUIC_TLS_MESSAGE_CLIENT_HANDSHAKE;
} else {
LogError("[ tls][%p][%c] Invalid message, %u.",
QuicTraceLogError("[ tls][%p][%c] Invalid message, %u.",
TlsContext, GetTlsIdentifier(TlsContext), ServerMessage->Type);
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -1025,7 +1025,7 @@ QuicTlsClientProcess(
case QUIC_TLS_MESSAGE_CLIENT_HANDSHAKE: {
if (ServerMessage->Type != QUIC_TLS_MESSAGE_TICKET) {
LogError("[ tls][%p][%c] Invalid message, %u.",
QuicTraceLogError("[ tls][%p][%c] Invalid message, %u.",
TlsContext, GetTlsIdentifier(TlsContext), ServerMessage->Type);
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -1040,7 +1040,7 @@ QuicTlsClientProcess(
}
default: {
LogError("[ tls][%p][%c] Invalid last message, %u.",
QuicTraceLogError("[ tls][%p][%c] Invalid last message, %u.",
TlsContext, GetTlsIdentifier(TlsContext), TlsContext->LastMessageType);
*ResultFlags |= QUIC_TLS_RESULT_ERROR;
break;
@ -1065,7 +1065,7 @@ QuicTlsHasValidMessageToProcess(
}
if (BufferLength < 7) {
LogVerbose("[ tls][%p][%c] Insufficient data to process header.",
QuicTraceLogVerbose("[ tls][%p][%c] Insufficient data to process header.",
TlsContext, GetTlsIdentifier(TlsContext));
return FALSE;
}
@ -1073,7 +1073,7 @@ QuicTlsHasValidMessageToProcess(
const QUIC_FAKE_TLS_MESSAGE* Message = (QUIC_FAKE_TLS_MESSAGE*)Buffer;
uint32_t MessageLength = TlsReadUint24(Message->Length) + 4;
if (BufferLength < MessageLength) {
LogVerbose("[ tls][%p][%c] Insufficient data to process %u bytes.",
QuicTraceLogVerbose("[ tls][%p][%c] Insufficient data to process %u bytes.",
TlsContext, GetTlsIdentifier(TlsContext), MessageLength);
return FALSE;
}
@ -1092,7 +1092,7 @@ QuicTlsProcessData(
)
{
if (*BufferLength) {
LogVerbose("[ tls][%p][%c] Processing %u received bytes.",
QuicTraceLogVerbose("[ tls][%p][%c] Processing %u received bytes.",
TlsContext, GetTlsIdentifier(TlsContext), *BufferLength);
}
@ -1107,11 +1107,11 @@ QuicTlsProcessData(
QuicTlsClientProcess(TlsContext, &ResultFlags, State, BufferLength, Buffer);
}
LogInfo("[ tls][%p][%c] Consumed %u bytes.",
QuicTraceLogInfo("[ tls][%p][%c] Consumed %u bytes.",
TlsContext, GetTlsIdentifier(TlsContext), *BufferLength);
if (State->BufferLength > PrevBufferLength) {
LogInfo("[ tls][%p][%c] Produced %hu bytes.",
QuicTraceLogInfo("[ tls][%p][%c] Produced %hu bytes.",
TlsContext, GetTlsIdentifier(TlsContext), (State->BufferLength - PrevBufferLength));
}

Просмотреть файл

@ -102,17 +102,17 @@ LogTestFailure(
va_start(Args, Format);
(void)_vsnprintf_s(Buffer, sizeof(Buffer), _TRUNCATE, Format, Args);
va_end(Args);
LogError("[test] FAILURE - %s:%d - %s", File, Line, Buffer);
QuicTraceLogError("[test] FAILURE - %s:%d - %s", File, Line, Buffer);
GTEST_MESSAGE_AT_(File, Line, Buffer, ::testing::TestPartResult::kFatalFailure);
}
struct TestLogger {
const char* TestName;
TestLogger(const char* Name) : TestName(Name) {
LogInfo("[test] START %s", TestName);
QuicTraceLogInfo("[test] START %s", TestName);
}
~TestLogger() {
LogInfo("[test] END %s", TestName);
QuicTraceLogInfo("[test] END %s", TestName);
}
};
@ -121,10 +121,10 @@ struct TestLoggerT {
const char* TestName;
TestLoggerT(const char* Name, const T& Params) : TestName(Name) {
std::ostringstream stream; stream << Params;
LogInfo("[test] START %s, %s", TestName, stream.str().c_str());
QuicTraceLogInfo("[test] START %s, %s", TestName, stream.str().c_str());
}
~TestLoggerT() {
LogInfo("[test] END %s", TestName);
QuicTraceLogInfo("[test] END %s", TestName);
}
};

Просмотреть файл

@ -39,7 +39,7 @@ void QuicTestInitialize()
QUIC_PARAM_REGISTRATION_ENCRYPTION,
sizeof(Disabled),
&Disabled))) {
LogError("[test] Disabling encryption failed");
QuicTraceLogError("[test] Disabling encryption failed");
}
#endif
}
@ -52,10 +52,10 @@ struct TestScopeLogger
{
const char* Name;
TestScopeLogger(const char* name) : Name(name) {
LogInfo("[test]---> %s", Name);
QuicTraceLogInfo("[test]---> %s", Name);
}
~TestScopeLogger() {
LogInfo("[test]<--- %s", Name);
QuicTraceLogInfo("[test]<--- %s", Name);
}
};

Просмотреть файл

@ -277,18 +277,18 @@ const char* CxnShortState(_In_ CXN* Cxn)
}
/*
ID State Age Active Queue Idle TX RX
(us) (us) (us) (us) (B) (B)
497 UNKNOWN 6140863 1830 538662 5600265 0 0
561 UNKNOWN 6264427 1825 537906 5724584 0 0
760 UNKNOWN 6183284 1767 537374 5613273 0 0
525 UNKNOWN 6186948 1757 535821 5618185 0 0
499 UNKNOWN 6250781 1855 535766 5713048 0 0
1008 UNKNOWN 6180047 1680 534083 5622105 0 0
498 UNKNOWN 6250791 1681 533620 5683344 0 0
1152 UNKNOWN 6155561 1740 533519 5620182 0 0
304 UNKNOWN 6197423 1643 532606 5632627 0 0
1574 UNKNOWN 6140501 1670 531907 5606820 0 0
ID State Age Active Queue Idle TX RX Local Remote Source Destination
(us) (us) (us) (us) (B) (B) IP IP CID CID
1 CONNECT 10262 3449 253 6540 3417 2977 10.228.101.54:443 10.228.101.148:50276 980539EF482B15CE 0081ACA53BAA3777
2 CONNECT 4871 2777 116 1962 2031 2977 10.228.101.54:443 10.228.101.148:50277 E5865654E08FD767 0042CA1037EA0C0B
3 CONNECT 5241 2669 128 2427 2031 2977 10.228.101.54:443 10.228.101.148:50278 1AE746C27E748386 0043E62A8B8EBB8C
4 CONNECT 5453 2831 225 2378 2031 2977 10.228.101.54:443 10.228.101.148:50279 426834ED9F012754 00C437DB702918BE
5 CONNECT 5213 2693 120 2383 2031 2977 10.228.101.54:443 10.228.101.148:50280 4BA9AD36454BE269 0085C40BDABF7C09
6 CONNECT 4646 2757 142 1728 2031 2977 10.228.101.54:443 10.228.101.148:50281 D74ACAB3ADA763FE 0006FB7E2933A165
7 CONNECT 5563 2744 147 2654 2031 2977 10.228.101.54:443 10.228.101.148:50282 220B2401DA530AFC 0047429971FD0421
8 CONNECT 5626 2764 158 2689 2031 2977 10.228.101.54:443 10.228.101.148:50283 DDAC7AB527FA87E8 00C8B6293C55ED5F
9 CONNECT 5444 2730 162 2536 2031 2977 10.228.101.54:443 10.228.101.148:50284 75CDBEF0873D20C9 0049D58DD89A0F4F
10 CONNECT 5316 2527 138 2634 2031 2977 10.228.101.54:443 10.228.101.148:50285 A24ED01EB3B5B306 008AA39BA9D4D97E
*/
void OutputCxnOneLineSummary(_In_ CXN* Cxn)
@ -297,23 +297,40 @@ void OutputCxnOneLineSummary(_In_ CXN* Cxn)
return;
}
const char* FormatStr = "%6lu %s %10llu %10llu %10llu %10llu %10llu %10llu\n";
const char* FormatCsvStr = "%lu,%s,%llu,%llu,%llu,%llu,%llu,%llu\n";
const char* FormatStr = "%6lu %s %10llu %10llu %10llu %10llu %10llu %10llu %22s %22s %18s %18s\n";
const char* FormatCsvStr = "%lu,%s,%llu,%llu,%llu,%llu,%llu,%llu,%s,%s,%s,%s\n";
if (!Cmd.FormatCSV && ((Trace.OutputLineCount-1) % 10) == 0) {
if (Trace.OutputLineCount != 1) printf("\n");
printf(" ID State Age Active Queue Idle TX RX\n");
printf(" (us) (us) (us) (us) (B) (B)\n");
printf(" ID State Age Active Queue Idle TX RX Local Remote Source Destination\n");
printf(" (us) (us) (us) (us) (B) (B) IP IP CID CID\n");
}
ULONG64 Age = NS100_TO_US(Cxn->FinalTimestamp - Cxn->InitialTimestamp);
char LocalAddrStr[INET6_ADDRSTRLEN];
AddrToString(&Cxn->LocalAddress, LocalAddrStr);
char RemoteAddrStr[INET6_ADDRSTRLEN];
AddrToString(&Cxn->RemoteAddress, RemoteAddrStr);
char SrcCidStr[QUIC_CID_MAX_STR_LEN] = "UNKNOWN";
if (Cxn->SrcCids != NULL) {
CidToString(Cxn->SrcCids->Length, Cxn->SrcCids->Buffer, SrcCidStr);
}
char DestCidStr[QUIC_CID_MAX_STR_LEN] = "UNKNOWN";
if (Cxn->DestCids != NULL) {
CidToString(Cxn->DestCids->Length, Cxn->DestCids->Buffer, DestCidStr);
}
printf(
Cmd.FormatCSV ? FormatCsvStr : FormatStr,
Cxn->Id, CxnShortState(Cxn), Age,
Cxn->SchedulingStats[QUIC_SCHEDULE_PROCESSING].TotalCpuTime,
Cxn->SchedulingStats[QUIC_SCHEDULE_QUEUED].TotalCpuTime,
Cxn->SchedulingStats[QUIC_SCHEDULE_IDLE].TotalCpuTime,
Cxn->BytesSent, Cxn->BytesReceived);
Cxn->BytesSent, Cxn->BytesReceived,
LocalAddrStr, RemoteAddrStr,
SrcCidStr, DestCidStr);
}
/*
@ -494,7 +511,7 @@ void OutputCxnSummary(_In_ CXN* Cxn)
}
printf(" DestCids ");
if (Cxn->SrcCids == NULL) {
if (Cxn->DestCids == NULL) {
printf("UNKNOWN\n");
} else {
CID* Cid = Cxn->DestCids;
@ -522,7 +539,7 @@ void OutputCxnSummary(_In_ CXN* Cxn)
} else {
STREAM* Stream = Cxn->Streams;
while (Stream) {
printf("%llX (#%llu) (id %u)\n",
printf("%llX (#%llu) (id %u)\n ",
Stream->Ptr,
Stream->StreamId,
Stream->Id);

Просмотреть файл

@ -516,7 +516,7 @@ void ProcessCommandArgs(int argc, char** argv)
if (Cmd.FormatCSV) {
switch (Cmd.Command) {
case COMMAND_CONN_LIST:
printf("ID,State,Age(us),Active(us),Queued(us),Idle(us),TX,RX\n");
printf("ID,State,Age(us),Active(us),Queued(us),Idle(us),TX,RX,LocalIp,RemoteIp,SourceCID,DestinationCID\n");
break;
case COMMAND_CONN_TPUT:
printf("ms,TxMbps,RxMbps,RttMs,CongEvents,InFlight,Cwnd,TxBufBytes,FlowAvailStrm,FlowAvailConn,SsThresh,CubicK,CubicWindowMax,StrmSndWnd\n");

Просмотреть файл

@ -511,6 +511,7 @@ QUIC_THREAD_CALLBACK(ServerSpin, Context)
PRINT("MsQuic->ListenerOpen(%p, ...) = ", session);
QUIC_STATUS Status = MsQuic->ListenerOpen(session, SpinQuicServerHandleListenerEvent, &Connections, &Listener);
PRINT("0x%x\n", Status);
UNREFERENCED_PARAMETER(Status);
QUIC_ADDR sockAddr = { 0 };
QuicAddrSetFamily(&sockAddr, (rand() % 2) ? AF_INET : AF_UNSPEC);
@ -519,6 +520,7 @@ QUIC_THREAD_CALLBACK(ServerSpin, Context)
PRINT("MsQuic->ListenerStart(%p, {*:%d}) = ", Listener, pt);
Status = MsQuic->ListenerStart(Listener, &sockAddr);
PRINT("0x%x\n", Status);
UNREFERENCED_PARAMETER(Status);
Listeners.push_back(Listener);
}