mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
Change pool, change mux connection close ,change copy buffer
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package conn
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/pool"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/vender/github.com/golang/snappy"
|
||||
"io"
|
||||
)
|
||||
@@ -31,8 +31,8 @@ func (s *SnappyConn) Write(b []byte) (n int, err error) {
|
||||
|
||||
//snappy压缩读
|
||||
func (s *SnappyConn) Read(b []byte) (n int, err error) {
|
||||
buf := pool.BufPool.Get().([]byte)
|
||||
defer pool.BufPool.Put(buf)
|
||||
buf := common.BufPool.Get().([]byte)
|
||||
defer common.BufPool.Put(buf)
|
||||
if n, err = s.r.Read(buf); err != nil {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user