From da0c8ea073c31faa28e2d257d64c1fcdf86ca38b Mon Sep 17 00:00:00 2001 From: Stephen Blinick Date: Sun, 10 Feb 2019 15:23:42 -0700 Subject: [PATCH] Clean out stale data in ring buffer when client disconnects. --- src/rtl_tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c index d6602ed..7f34fdb 100644 --- a/src/rtl_tcp.c +++ b/src/rtl_tcp.c @@ -580,6 +580,10 @@ int main(int argc, char **argv) closesocket(s); printf("all threads dead..\n"); + + // Clear stale data for next client + ringbuf_head = ringbuf_tail = 0; + memset(ringbuf, 0, ringbuf_sz); do_exit = 0; }