Skip to content

Commit

Permalink
Remove custom listener handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianpick committed Jan 8, 2024
1 parent 5ccf8e2 commit c98695c
Showing 1 changed file with 5 additions and 34 deletions.
39 changes: 5 additions & 34 deletions src/test/lib/DataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,39 +1493,6 @@ QuicCancelOnLossConnectionHandler(
return Status;
}

_IRQL_requires_max_(PASSIVE_LEVEL)
_Function_class_(QUIC_LISTENER_CALLBACK)
QUIC_STATUS
QuicCancelOnLossListenerHandler(
_In_ MsQuicListener* /* Listener */,
_In_opt_ void* Context,
_Inout_ QUIC_LISTENER_EVENT* Event
)
{
if (Context == nullptr) {
return QUIC_STATUS_INVALID_PARAMETER;
}

auto TestContext = reinterpret_cast<CancelOnLossContext*>(Context);

QUIC_STATUS Status = QUIC_STATUS_SUCCESS;

switch (Event->Type) {
case QUIC_LISTENER_EVENT_NEW_CONNECTION:
TestContext->Connection = new MsQuicConnection(
Event->NEW_CONNECTION.Connection,
CleanUpManual,
QuicCancelOnLossConnectionHandler,
Context);
TestContext->Connection->SetConfiguration(*TestContext->Configuration);
break;
default:
break;
}

return Status;
}

void
QuicCancelOnLossSend(
_In_ bool DropPackets
Expand Down Expand Up @@ -1554,7 +1521,7 @@ QuicCancelOnLossSend(
CancelOnLossContext ServerContext{ DropPackets, true /* IsServer */, &ServerConfiguration};
QuicAddr ServerLocalAddr;

MsQuicListener Listener(Registration, CleanUpManual, QuicCancelOnLossListenerHandler, &ServerContext);
MsQuicAutoAcceptListener Listener(Registration, ServerConfiguration, QuicCancelOnLossConnectionHandler, &ServerContext);
TEST_TRUE(Listener.IsValid());
TEST_EQUAL(Listener.Start(Alpn), QUIC_STATUS_SUCCESS);
TEST_EQUAL(Listener.GetLocalAddr(ServerLocalAddr), QUIC_STATUS_SUCCESS);
Expand Down Expand Up @@ -1640,6 +1607,10 @@ QuicCancelOnLossSend(
} else {
TEST_EQUAL(ServerContext.ExitCode, CancelOnLossContext::SuccessExitCode);
}

if (Listener.LastConnection) {
Listener.LastConnection->Close();
}
}

struct RecvResumeTestContext {
Expand Down

0 comments on commit c98695c

Please sign in to comment.