forked from mirror/ledisdb
update godep
This commit is contained in:
parent
e59300c5b2
commit
0e2f2569a0
|
@ -60,7 +60,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/siddontang/goredis",
|
||||
"Rev": "6d2857b0488d1e8b9f96b46802eacb68e29fb003"
|
||||
"Rev": "41bbdaa8d2015389bfa495ee4e7ee4d150376751"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/siddontang/rdb",
|
||||
|
|
|
@ -13,6 +13,10 @@ type PoolConn struct {
|
|||
}
|
||||
|
||||
func (c *PoolConn) Close() {
|
||||
if c.Conn.closed {
|
||||
return
|
||||
}
|
||||
|
||||
c.c.put(c.Conn)
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ type Conn struct {
|
|||
|
||||
totalReadSize sizeWriter
|
||||
totalWriteSize sizeWriter
|
||||
|
||||
closed bool
|
||||
}
|
||||
|
||||
func Connect(addr string) (*Conn, error) {
|
||||
|
@ -55,11 +57,18 @@ func ConnectWithSize(addr string, readSize int, writeSize int) (*Conn, error) {
|
|||
c.br = bufio.NewReaderSize(io.TeeReader(c.c, &c.totalReadSize), readSize)
|
||||
c.bw = bufio.NewWriterSize(io.MultiWriter(c.c, &c.totalWriteSize), writeSize)
|
||||
|
||||
c.closed = false
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *Conn) Close() {
|
||||
if c.closed {
|
||||
return
|
||||
}
|
||||
|
||||
c.c.Close()
|
||||
c.closed = true
|
||||
}
|
||||
|
||||
func (c *Conn) GetTotalReadSize() int64 {
|
||||
|
|
Loading…
Reference in New Issue