cloudflared-mirror/connection
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
..
connection.go UN-5213: Increase MaxStreams value for QUIC transport 2021-10-08 13:48:20 +01:00
connection_test.go Revert "TUN-5184: Make sure outstanding websocket write is finished, and no more writes after shutdown" 2021-10-25 19:51:52 +01:00
control.go TUN-5204: Unregister QUIC transports on disconnect 2022-01-06 10:08:38 +00:00
errors.go TUN-3811: Better error reporting on http2 connection termination. Registration errors from control loop are now propagated out of the connection server code. Unified error handling between h2mux and http2 connections so we log and retry errors the same way, regardless of underlying transport. 2021-01-28 10:38:30 -06:00
event.go TUN-4821: Make quick tunnels the default in cloudflared 2021-08-26 15:53:02 +00:00
h2mux.go TUN-4701: Split Proxy into ProxyHTTP and ProxyTCP 2021-07-19 13:43:59 +00:00
h2mux_header.go TUN-5393: Content-length is no longer a control header for non-h2mux transports 2021-11-17 10:56:15 +00:00
h2mux_header_test.go TUN-5393: Content-length is no longer a control header for non-h2mux transports 2021-11-17 10:56:15 +00:00
h2mux_test.go Revert "TUN-5184: Make sure outstanding websocket write is finished, and no more writes after shutdown" 2021-10-25 19:51:52 +01:00
header.go TUN-5393: Content-length is no longer a control header for non-h2mux transports 2021-11-17 10:56:15 +00:00
header_test.go TUN-5393: Content-length is no longer a control header for non-h2mux transports 2021-11-17 10:56:15 +00:00
http2.go TUN-5204: Unregister QUIC transports on disconnect 2022-01-06 10:08:38 +00:00
http2_test.go Revert "TUN-5184: Make sure outstanding websocket write is finished, and no more writes after shutdown" 2021-10-25 19:51:52 +01:00
json.go TUN-3467: Serialize cf-cloudflared-response-meta during package initialization using jsoniter 2020-11-11 15:11:42 +00:00
metrics.go TUN-4067: Reformat code for consistent import order, grouping, and fix formatting. Added goimports target to the Makefile to make this easier in the future. 2021-03-24 10:53:29 -05:00
observer.go TUN-4821: Make quick tunnels the default in cloudflared 2021-08-26 15:53:02 +00:00
observer_test.go TUN-4821: Make quick tunnels the default in cloudflared 2021-08-26 15:53:02 +00:00
protocol.go TUN-5616: Never fallback transport if user chooses it on purpose 2022-01-06 09:20:59 +00:00
protocol_test.go TUN-5616: Never fallback transport if user chooses it on purpose 2022-01-06 09:20:59 +00:00
quic.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
quic_test.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
rpc.go TUN-4821: Make quick tunnels the default in cloudflared 2021-08-26 15:53:02 +00:00
tunnelsforha.go TUN-3471: Add structured log context to logs 2021-01-05 20:21:16 +00:00