vendor: Update pfilter (ref #4561)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4572
This commit is contained in:
parent
257c3f5e82
commit
60bceb0f09
2
vendor/github.com/AudriusButkevicius/pfilter/conn.go
generated
vendored
2
vendor/github.com/AudriusButkevicius/pfilter/conn.go
generated
vendored
@ -74,7 +74,7 @@ func (r *FilteredConn) ReadFrom(b []byte) (n int, addr net.Addr, err error) {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
return 0, nil, &timeoutError{}
|
return 0, nil, errTimeout
|
||||||
case pkt := <-r.recvBuffer:
|
case pkt := <-r.recvBuffer:
|
||||||
copy(b[:pkt.n], pkt.buf)
|
copy(b[:pkt.n], pkt.buf)
|
||||||
bufPool.Put(pkt.buf[:maxPacketSize])
|
bufPool.Put(pkt.buf[:maxPacketSize])
|
||||||
|
|||||||
27
vendor/github.com/AudriusButkevicius/pfilter/misc.go
generated
vendored
27
vendor/github.com/AudriusButkevicius/pfilter/misc.go
generated
vendored
@ -1,7 +1,6 @@
|
|||||||
package pfilter
|
package pfilter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
@ -13,14 +12,30 @@ var (
|
|||||||
return make([]byte, maxPacketSize)
|
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 *netError) Error() string { return e.msg }
|
||||||
func (e *timeoutError) Timeout() bool { return true }
|
func (e *netError) Timeout() bool { return e.timeout }
|
||||||
func (e *timeoutError) Temporary() bool { return true }
|
func (e *netError) Temporary() bool { return e.temporary }
|
||||||
|
|
||||||
type filteredConnList []*FilteredConn
|
type filteredConnList []*FilteredConn
|
||||||
|
|
||||||
|
|||||||
2
vendor/manifest
vendored
2
vendor/manifest
vendored
@ -29,7 +29,7 @@
|
|||||||
"importpath": "github.com/AudriusButkevicius/pfilter",
|
"importpath": "github.com/AudriusButkevicius/pfilter",
|
||||||
"repository": "https://github.com/AudriusButkevicius/pfilter",
|
"repository": "https://github.com/AudriusButkevicius/pfilter",
|
||||||
"vcs": "git",
|
"vcs": "git",
|
||||||
"revision": "56143fe9cebe95636de1275acf30fcca36a1383d",
|
"revision": "9dca34a5b530bfc9843fa8aa2ff08ff9821032cb",
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"notests": true
|
"notests": true
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user