From 937ce9fbebaa8ae95e01bab7e5c4a81ddee5ccf3 Mon Sep 17 00:00:00 2001 From: gekigek99 <53654579+gekigek99@users.noreply.github.com> Date: Thu, 9 Mar 2023 19:48:31 +0100 Subject: [PATCH] conn: prot: improved comments --- lib/conn/conn-prot.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/conn/conn-prot.go b/lib/conn/conn-prot.go index cb542fd..73352bf 100644 --- a/lib/conn/conn-prot.go +++ b/lib/conn/conn-prot.go @@ -175,8 +175,10 @@ func getPing(clientConn net.Conn) *errco.MshLog { switch { case bytes.HasPrefix(pingData, []byte{9, 1, 0, 0, 0, 0, 0}): + // this is a normal ping // packet is [9 1 0 0 0 0 0 89 73 114] - // this is normal ping + // using [9 1 0 0 0 0 0] as prefix is a conservative check + // in case other "normal" pings are discovered it's possible to use a shorter/different prefix check case bytes.Equal(pingData, []byte{1, 0}): // packet is [1 0]