From e0a4b7756e8923c143b03eb8716290275b110663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 13 Jan 2023 16:38:32 +0800 Subject: [PATCH] Fix ?? --- transport/mtproto/conn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transport/mtproto/conn.go b/transport/mtproto/conn.go index 67df2b14..85099816 100644 --- a/transport/mtproto/conn.go +++ b/transport/mtproto/conn.go @@ -3,6 +3,7 @@ package mtproto import ( "crypto/cipher" "encoding/binary" + "io" "net" "sync" @@ -40,7 +41,10 @@ func (c *FakeTLSConn) SetupObfs2(en, de cipher.Stream) { } func (c *FakeTLSConn) read(p []byte) (n int, err error) { - n, err = c.Conn.Read(p) + n, err = io.ReadFull(c.Conn, p) + if err != nil { + return + } if c.clientDecryptor != nil { c.clientDecryptor.XORKeyStream(p, p[:n]) }