Skip to content

Commit

Permalink
conn: prot: improved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gekigek99 committed Mar 9, 2023
1 parent 22b0877 commit 937ce9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/conn/conn-prot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 937ce9f

Please sign in to comment.