From 585d5ba7c8b64f6da60837546a70bbcfd2350c64 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:55:54 -0400 Subject: [PATCH] Fix Vision reader --- proxy/proxy.go | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index 142acb77..f07af8c3 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -159,21 +159,15 @@ func (w *VisionReader) ReadMultiBuffer() (buf.MultiBuffer, error) { } } buffer = mb2 - if w.trafficState.RemainingContent == 0 && w.trafficState.RemainingPadding == 0 { - if w.trafficState.CurrentCommand == 1 { - w.trafficState.WithinPaddingBuffers = false - } else if w.trafficState.CurrentCommand == 2 { - w.trafficState.WithinPaddingBuffers = false - w.trafficState.ReaderSwitchToDirectCopy = true - } else if w.trafficState.CurrentCommand == 0 { - w.trafficState.WithinPaddingBuffers = true - } else { - newError("XtlsRead unknown command ", w.trafficState.CurrentCommand, buffer.Len()).WriteToLog(session.ExportIDToError(w.ctx)) - } - } else if w.trafficState.RemainingContent > 0 || w.trafficState.RemainingPadding > 0 { + if w.trafficState.RemainingContent > 0 || w.trafficState.RemainingPadding > 0 || w.trafficState.CurrentCommand == 0 { w.trafficState.WithinPaddingBuffers = true - } else { + } else if w.trafficState.CurrentCommand == 1 { w.trafficState.WithinPaddingBuffers = false + } else if w.trafficState.CurrentCommand == 2 { + w.trafficState.WithinPaddingBuffers = false + w.trafficState.ReaderSwitchToDirectCopy = true + } else { + newError("XtlsRead unknown command ", w.trafficState.CurrentCommand, buffer.Len()).WriteToLog(session.ExportIDToError(w.ctx)) } } if w.trafficState.NumberOfPacketToFilter > 0 {