fix(netxlite/quic): wrap Close (#509)
While there, make sure netxlite has 100% coverage. Part of https://github.com/ooni/probe/issues/1733 and diff has been extracted from https://github.com/ooni/probe-cli/pull/506.
This commit is contained in:
parent
deb1589bdb
commit
273774bb03
3 changed files with 48 additions and 1 deletions
|
|
@ -394,6 +394,16 @@ func (c *quicErrWrapperUDPLikeConn) ReadFrom(b []byte) (int, net.Addr, error) {
|
|||
return n, addr, nil
|
||||
}
|
||||
|
||||
// Close implements quicx.UDPLikeConn.Close.
|
||||
func (c *quicErrWrapperUDPLikeConn) Close() error {
|
||||
err := c.UDPLikeConn.Close()
|
||||
if err != nil {
|
||||
return errorsx.NewErrWrapper(
|
||||
errorsx.ClassifyGenericError, errorsx.ReadFromOperation, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// quicDialerErrWrapper is a dialer that performs quic err wrapping
|
||||
type quicDialerErrWrapper struct {
|
||||
QUICDialer
|
||||
|
|
|
|||
Loading…
Reference in a new issue