This is an automated email from the ASF dual-hosted git repository.

wuxinfan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new dbf6162c4 Fix (Server): Avoid error reporting warning logs when 
detecting EOF via Peek to properly close the connection (#2790)
dbf6162c4 is described below

commit dbf6162c44326ef2b324e34286fe637934502612
Author: 1kasa <[email protected]>
AuthorDate: Sun Mar 9 14:14:19 2025 +0800

    Fix (Server): Avoid error reporting warning logs when detecting EOF via 
Peek to properly close the connection (#2790)
---
 protocol/jsonrpc/server.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/protocol/jsonrpc/server.go b/protocol/jsonrpc/server.go
index c77456932..3aecef8b7 100644
--- a/protocol/jsonrpc/server.go
+++ b/protocol/jsonrpc/server.go
@@ -123,6 +123,9 @@ func (s *Server) handlePkg(conn net.Conn) {
 
        for {
                bufReader := bufio.NewReader(io.LimitReader(conn, 
MaxHeaderSize))
+               if _, err := bufReader.Peek(1); err == io.EOF {
+                       return
+               }
                r, err := http.ReadRequest(bufReader)
                if err != nil {
                        logger.Warnf("[ReadRequest] error: %v", err)

Reply via email to