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:
Simone Basso 2021-09-27 14:14:17 +02:00 committed by GitHub
commit 273774bb03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 1 deletions

View file

@ -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