Revert "fdtrack: temporary hack for tracking file descriptor usage"
This reverts commit 5c949d3b3b
.
This commit is contained in:
@@ -34,7 +34,7 @@ var (
|
||||
// meteredConn is a wrapper around a network TCP connection that meters both the
|
||||
// inbound and outbound network traffic.
|
||||
type meteredConn struct {
|
||||
net.Conn
|
||||
*net.TCPConn // Network connection to wrap with metering
|
||||
}
|
||||
|
||||
// newMeteredConn creates a new metered connection, also bumping the ingress or
|
||||
@@ -45,13 +45,13 @@ func newMeteredConn(conn net.Conn, ingress bool) net.Conn {
|
||||
} else {
|
||||
egressConnectMeter.Mark(1)
|
||||
}
|
||||
return &meteredConn{conn}
|
||||
return &meteredConn{conn.(*net.TCPConn)}
|
||||
}
|
||||
|
||||
// Read delegates a network read to the underlying connection, bumping the ingress
|
||||
// traffic meter along the way.
|
||||
func (c *meteredConn) Read(b []byte) (n int, err error) {
|
||||
n, err = c.Conn.Read(b)
|
||||
n, err = c.TCPConn.Read(b)
|
||||
ingressTrafficMeter.Mark(int64(n))
|
||||
return
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func (c *meteredConn) Read(b []byte) (n int, err error) {
|
||||
// Write delegates a network write to the underlying connection, bumping the
|
||||
// egress traffic meter along the way.
|
||||
func (c *meteredConn) Write(b []byte) (n int, err error) {
|
||||
n, err = c.Conn.Write(b)
|
||||
n, err = c.TCPConn.Write(b)
|
||||
egressTrafficMeter.Mark(int64(n))
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user