diff --git a/vendor/github.com/AudriusButkevicius/pfilter/conn.go b/vendor/github.com/AudriusButkevicius/pfilter/conn.go index 5af73562..c5e6af5b 100644 --- a/vendor/github.com/AudriusButkevicius/pfilter/conn.go +++ b/vendor/github.com/AudriusButkevicius/pfilter/conn.go @@ -17,7 +17,7 @@ type FilteredConn struct { filter Filter - closed chan struct{} + closed chan struct{} } // LocalAddr returns the local address @@ -74,7 +74,7 @@ func (r *FilteredConn) ReadFrom(b []byte) (n int, addr net.Addr, err error) { select { case <-timeout: - return 0, nil, &timeoutError{} + return 0, nil, errTimeout case pkt := <-r.recvBuffer: copy(b[:pkt.n], pkt.buf) bufPool.Put(pkt.buf[:maxPacketSize]) diff --git a/vendor/github.com/AudriusButkevicius/pfilter/misc.go b/vendor/github.com/AudriusButkevicius/pfilter/misc.go index d865162d..8151bf92 100644 --- a/vendor/github.com/AudriusButkevicius/pfilter/misc.go +++ b/vendor/github.com/AudriusButkevicius/pfilter/misc.go @@ -1,7 +1,6 @@ package pfilter import ( - "fmt" "net" "sync" ) @@ -13,14 +12,30 @@ var ( return make([]byte, maxPacketSize) }, } - errClosed = fmt.Errorf("use of closed network connection") + errTimeout = &netError{ + msg: "i/o timeout", + timeout: true, + temporary: true, + } + errClosed = &netError{ + msg: "use of closed network connection", + timeout: false, + temporary: false, + } + + // Compile time interface assertion. + _ net.Error = (*netError)(nil) ) -type timeoutError struct{} +type netError struct { + msg string + timeout bool + temporary bool +} -func (e *timeoutError) Error() string { return "i/o timeout" } -func (e *timeoutError) Timeout() bool { return true } -func (e *timeoutError) Temporary() bool { return true } +func (e *netError) Error() string { return e.msg } +func (e *netError) Timeout() bool { return e.timeout } +func (e *netError) Temporary() bool { return e.temporary } type filteredConnList []*FilteredConn diff --git a/vendor/manifest b/vendor/manifest index 0442405b..fbcb937e 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -29,7 +29,7 @@ "importpath": "github.com/AudriusButkevicius/pfilter", "repository": "https://github.com/AudriusButkevicius/pfilter", "vcs": "git", - "revision": "56143fe9cebe95636de1275acf30fcca36a1383d", + "revision": "9dca34a5b530bfc9843fa8aa2ff08ff9821032cb", "branch": "master", "notests": true },