AlexStocks commented on a change in pull request #82:
URL: https://github.com/apache/dubbo-getty/pull/82#discussion_r739624806



##########
File path: session.go
##########
@@ -418,11 +419,23 @@ func (s *session) WriteBytes(pkg []byte) (int, error) {
                return 0, ErrSessionClosed
        }
 
-       lg, err := s.Connection.send(pkg)
+       totalSize := len(pkg)

Review comment:
               totalSize := len(pkg)
           pkgArray := make([][]byte, 0, totalSize / maxPacketLen + 1)
        writeSize := 0
        for totalSize >= maxPacketLen {
                    pkgArray = append(pkgArray, pkg[writeSize:(writeSize + 
maxPacketLen)])
                totalSize -= maxPacketLen
                writeSize += maxPacketLen
        }
           pkgArray = append(pkgArray, pkg[writeSize:])
           lg, err := s.Connection.send(pkgArray)
           if err != nil {
            return writeSize, perrors.Wrapf(err, "s.Connection.Write(pkg 
len:%d)", len(pkg))
           }




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to