From dd50a2016c9210fb00618cbf187f64a1128b2cd7 Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Tue, 5 Sep 2023 20:27:14 -0400 Subject: [PATCH] WPA Plugin Fixes for Stream Timing Breakdowns (#3841) --- src/plugins/trace/dll/DataModel/QuicStream.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugins/trace/dll/DataModel/QuicStream.cs b/src/plugins/trace/dll/DataModel/QuicStream.cs index ec429417af..08ee1a1161 100644 --- a/src/plugins/trace/dll/DataModel/QuicStream.cs +++ b/src/plugins/trace/dll/DataModel/QuicStream.cs @@ -12,7 +12,7 @@ public sealed class QuicStream : IQuicObject { public static QuicStream New(ulong pointer, uint processId) => new QuicStream(pointer, processId); - public static ushort CreateEventId => (ushort)QuicEventId.StreamCreated; + public static ushort CreateEventId => (ushort)QuicEventId.StreamAlloc; public static ushort DestroyedEventId => (ushort)QuicEventId.StreamDestroyed; @@ -218,6 +218,18 @@ internal void AddEvent(QuicEvent evt, QuicState state) } } + if (InitialTimeStamp > Timings.RecvPacket.PacketReceive) + { + // Stream was created after packet recieved + Timings.UpdateToState(QuicStreamState.Alloc, InitialTimeStamp); + } + + if (FinalTimeStamp > Timings.LastStateChangeTime) + { + // Other events between Decrypt and StreamReceiveFrame + Timings.UpdateToState(QuicStreamState.ProcessRecv, FinalTimeStamp); + } + Timings.UpdateToState(QuicStreamState.Read, evt.TimeStamp); } break;