From f97687e85f09d1ab6a2b303d9837ae6546379ef9 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 22 May 2024 16:29:28 +0800 Subject: [PATCH] chore: refine comments in bittorrent.go Signed-off-by: iosmanthus --- common/sniff/bittorrent.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/sniff/bittorrent.go b/common/sniff/bittorrent.go index 8779348d..ca5ec1c7 100644 --- a/common/sniff/bittorrent.go +++ b/common/sniff/bittorrent.go @@ -11,7 +11,7 @@ import ( "github.com/sagernet/sing-box/constant" ) -// BitTorrent detects if the input stream is a BitTorrent connection. +// BitTorrent detects if the stream is a BitTorrent connection. // For the BitTorrent protocol specification, see https://www.bittorrent.org/beps/bep_0003.html func BitTorrent(_ context.Context, reader io.Reader) (*adapter.InboundContext, error) { var first byte @@ -38,12 +38,12 @@ func BitTorrent(_ context.Context, reader io.Reader) (*adapter.InboundContext, e }, nil } -// UTP detects if the input packet is a uTP connection header. +// UTP detects if the packet is a uTP connection packet. // For the uTP protocol specification, see // 1. https://www.bittorrent.org/beps/bep_0029.html // 2. https://github.com/bittorrent/libutp/blob/2b364cbb0650bdab64a5de2abb4518f9f228ec44/utp_internal.cpp#L112 func UTP(_ context.Context, packet []byte) (*adapter.InboundContext, error) { - // A valid UTP must be at least 20 bytes long. + // A valid uTP packet must be at least 20 bytes long. if len(packet) < 20 { return nil, os.ErrInvalid }