From 34f14e8dc0565c5cf8dda9ecf6c147535e3b5006 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Wed, 1 Jul 2026 09:34:38 +0100 Subject: [PATCH] Fix a bug. The recorder was writing out the buffer instead of the OG data --- mockserver/record.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mockserver/record.go b/mockserver/record.go index 72dda92..89b0cfa 100644 --- a/mockserver/record.go +++ b/mockserver/record.go @@ -64,10 +64,10 @@ func (r *Recorder) record(ctx context.Context) { case <-ctx.Done(): return case data := <-r.recorderCh: - r.mut.RLock() - err := binary.Write(r.OutputFile, binary.LittleEndian, data) + r.mut.Lock() + err := binary.Write(r.OutputFile, binary.LittleEndian, r.SDK.Data) r.TotalBytes += len(data) - r.mut.RUnlock() + r.mut.Unlock() if err != nil { // NOTE: find a way of logging this somehow @@ -129,7 +129,7 @@ func (r *Recorder) Record(ctx context.Context) error { // Dropped the frame! } - // Send the data to the UDP socket + // Write the data to the file select { case r.recorderCh <- r.SDK.Buffer: // Sent the data