mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
master: fix connections count reporting
This commit is contained in:
parent
e1b5ac5c04
commit
4bc19f1e52
|
@ -35,6 +35,7 @@ type Conn struct {
|
||||||
net.Conn
|
net.Conn
|
||||||
ReadTimeout time.Duration
|
ReadTimeout time.Duration
|
||||||
WriteTimeout time.Duration
|
WriteTimeout time.Duration
|
||||||
|
isClosed bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) Read(b []byte) (count int, e error) {
|
func (c *Conn) Read(b []byte) (count int, e error) {
|
||||||
|
@ -66,7 +67,10 @@ func (c *Conn) Write(b []byte) (count int, e error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) Close() error {
|
func (c *Conn) Close() error {
|
||||||
stats.ConnectionClose()
|
if !c.isClosed {
|
||||||
|
stats.ConnectionClose()
|
||||||
|
c.isClosed = true
|
||||||
|
}
|
||||||
return c.Conn.Close()
|
return c.Conn.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue