From 91d2780bfc80fd534ec876db2b9f5197356eac76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 29 Jul 2022 23:59:19 +0800 Subject: [PATCH] Fix std read for server conn --- shadowaead/service.go | 4 ++++ shadowaead_2022/service.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/shadowaead/service.go b/shadowaead/service.go index 693c218..64091ba 100644 --- a/shadowaead/service.go +++ b/shadowaead/service.go @@ -176,6 +176,10 @@ func (c *serverConn) writeResponse(payload []byte) (n int, err error) { return } +func (c *serverConn) Read(b []byte) (n int, err error) { + return c.reader.Read(b) +} + func (c *serverConn) Write(p []byte) (n int, err error) { if c.writer != nil { return c.writer.Write(p) diff --git a/shadowaead_2022/service.go b/shadowaead_2022/service.go index 582c0e7..bec8e45 100644 --- a/shadowaead_2022/service.go +++ b/shadowaead_2022/service.go @@ -319,6 +319,10 @@ func (c *serverConn) writeResponse(payload []byte) (n int, err error) { return } +func (c *serverConn) Read(b []byte) (n int, err error) { + return c.reader.Read(b) +} + func (c *serverConn) Write(p []byte) (n int, err error) { if c.writer != nil { return c.writer.Write(p)