cloudflared-mirror/origin
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
..
cloudflare_status_page.go TUN-1350: Enhance error messages with cloudflarestatus.com link, if relevant 2019-01-18 13:37:05 -06:00
cloudflare_status_page_test.go TUN-3837: Remove automation_email from cloudflared status page test 2021-02-01 15:07:37 +00:00
conn_aware_logger.go TUN-5368: Log connection issues with LogLevel that depends on tunnel state 2021-11-10 09:00:05 +00:00
external_control.go Fixed connection error handling by removing duplicated errors, standardizing on non-pointer error types 2021-01-22 10:58:06 -06: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
pool.go TUN-4063: Cleanup dependencies between packages. 2021-03-09 14:02:59 +00:00
proxy.go TUN-5724: Fix SSE streaming by guaranteeing we write everything we read 2022-01-28 14:48:54 +00:00
proxy_posix_test.go TUN-5551: Reintroduce FIPS compliance for linux amd64 now as separate binaries 2021-12-20 21:50:42 +00:00
proxy_test.go TUN-5724: Fix SSE streaming by guaranteeing we write everything we read 2022-01-28 14:48:54 +00:00
reconnect.go Fix typos 2021-11-12 17:38:06 +02:00
reconnect_test.go TUN-3863: Consolidate header handling logic in the connection package; move headers definitions from h2mux to packages that manage them; cleanup header conversions 2021-03-29 21:57:56 +00:00
supervisor.go TUN-5368: Log connection issues with LogLevel that depends on tunnel state 2021-11-10 09:00:05 +00:00
tunnel.go TUN-5621: Correctly manage QUIC stream closing 2022-02-01 22:01:57 +00:00
tunnel_test.go TUN-5719: Re-attempt connection to edge with QUIC despite network error when there is no fallback 2022-01-27 22:12:25 +00:00
tunnelsforha.go TUN-1270: cloudflared panic (HA metrics missing label) 2018-12-11 11:41:49 -06:00