ooni-probe-cli/internal/netxlite
Simone Basso a4d61a4be4
fix(netxlite): close quic packetconn (#407)
Noticed when working on https://github.com/ooni/probe/issues/1505.

Justification for this diff:

1. [DialEarlyContext calls dialContext with the last argument set to false](https://github.com/lucas-clemente/quic-go/blob/v0.21.1/client.go#L153);

2. [the semantics of the last argument is whether we own the connection](https://github.com/lucas-clemente/quic-go/blob/v0.21.1/client.go#L187);

3. [this value is propagated to the client data structure](https://github.com/lucas-clemente/quic-go/blob/v0.21.1/client.go#L269);

4. [client.dial](https://github.com/lucas-clemente/quic-go/blob/v0.21.1/client.go#L302) runs the session in a background goroutine and only destroys the `packetHandlers` when the connection is owned;

5. [packetHandlerMap.Destroy](https://github.com/lucas-clemente/quic-go/blob/v0.21.1/packet_handler_map.go#L293) closes the underlying PacketConn.

6. also, the documentation clearly states that when you use `DialEarlyContext` you can use the same packet conn multiple times, so it does not take ownership.
2021-06-25 17:58:42 +02:00
..
certifi.go refactor: merge tlsx into netxlite (#403) 2021-06-25 12:39:45 +02:00
certifigen.go refactor: merge tlsx into netxlite (#403) 2021-06-25 12:39:45 +02:00
dialer_test.go refactor(netxlite): make sure we always use netxmocks (#399) 2021-06-23 17:00:44 +02:00
dialer.go refactor(netxlite): make sure we always use netxmocks (#399) 2021-06-23 17:00:44 +02:00
doc.go refactor: start pivoting netx (#396) 2021-06-23 15:53:12 +02:00
legacy_test.go refactor(netxlite): make sure we always use netxmocks (#399) 2021-06-23 17:00:44 +02:00
legacy.go refactor: start pivoting netx (#396) 2021-06-23 15:53:12 +02:00
logger.go refactor: start pivoting netx (#396) 2021-06-23 15:53:12 +02:00
quic_test.go fix(netxlite): close quic packetconn (#407) 2021-06-25 17:58:42 +02:00
quic.go fix(netxlite): close quic packetconn (#407) 2021-06-25 17:58:42 +02:00
resolver_test.go refactor(netxlite): make sure we always use netxmocks (#399) 2021-06-23 17:00:44 +02:00
resolver.go refactor: move tls handshaker to netxlite (#400) 2021-06-25 11:07:26 +02:00
tlsdialer_test.go refactor: move tlsdialer to netxlite (#404) 2021-06-25 13:42:48 +02:00
tlsdialer.go refactor: move tlsdialer to netxlite (#404) 2021-06-25 13:42:48 +02:00
tlshandshaker_test.go refactor(netx): move tlshandshaker logger to netxlite (#402) 2021-06-25 12:21:34 +02:00
tlshandshaker.go refactor: merge tlsx into netxlite (#403) 2021-06-25 12:39:45 +02:00
tlsx_test.go refactor: merge tlsx into netxlite (#403) 2021-06-25 12:39:45 +02:00
tlsx.go refactor: merge tlsx into netxlite (#403) 2021-06-25 12:39:45 +02:00