cloudflared-mirror/quic
Nuno Diegues ed2bac026d TUN-5621: Correctly manage QUIC stream closing
Until this PR, we were naively closing the quic.Stream whenever
the callstack for handling the request (HTTP or TCP) finished.
However, our proxy handler may still be reading or writing from
the quic.Stream at that point, because we return the callstack if
either side finishes, but not necessarily both.

This is a problem for quic-go library because quic.Stream#Close
cannot be called concurrently with quic.Stream#Write

Furthermore, we also noticed that quic.Stream#Close does nothing
to do receiving stream (since, underneath, quic.Stream has 2 streams,
1 for each direction), thus leaking memory, as explained in:
https://github.com/lucas-clemente/quic-go/issues/3322

This PR addresses both problems by wrapping the quic.Stream that
is passed down to the proxying logic and handle all these concerns.
2022-02-01 22:01:57 +00:00
..
schema TUN-4596: Add QUIC application protocol for QUIC stream handshake 2021-07-15 17:35:25 +00:00
conversion.go TUN-5261: Collect QUIC metrics about RTT, packets and bytes transfered and log events at tracing level 2021-10-21 15:26:57 +01:00
datagram.go TUN-5623: Configure quic max datagram frame size to 1350 bytes for none Windows platforms 2022-01-11 14:55:43 +00:00
datagram_test.go TUN-5623: Configure quic max datagram frame size to 1350 bytes for none Windows platforms 2022-01-11 14:55:43 +00:00
metrics.go Fix typos 2021-11-12 17:38:06 +02:00
param_unix.go TUN-5623: Configure quic max datagram frame size to 1350 bytes for none Windows platforms 2022-01-11 14:55:43 +00:00
param_windows.go TUN-5623: Configure quic max datagram frame size to 1350 bytes for none Windows platforms 2022-01-11 14:55:43 +00:00
pogs.go TUN-4597: Added HTTPProxy for QUIC 2021-08-04 12:50:18 +00:00
quic_protocol.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
quic_protocol_test.go TUN-5494: Send a RPC with terminate reason to edge if the session is closed locally 2021-12-21 09:52:39 +00:00
safe_stream.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
safe_stream_test.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
test_utils.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
tracing.go TUN-5261: Collect QUIC metrics about RTT, packets and bytes transfered and log events at tracing level 2021-10-21 15:26:57 +01:00