]> git.feebdaed.xyz Git - 0xmirror/quic-go.git/commitdiff
fix Goroutine leak on version negotiation race with context cancel (#5203)
authorMarten Seemann <martenseemann@gmail.com>
Sun, 8 Jun 2025 03:19:46 +0000 (11:19 +0800)
committerGitHub <noreply@github.com>
Sun, 8 Jun 2025 03:19:46 +0000 (05:19 +0200)
transport.go

index 525adb3f1c4a54d5ea2b4ae06210ce33d369d80b..a755f8971aa3e8062e2437aa32ad9b6b82b8b23d 100644 (file)
@@ -327,8 +327,9 @@ func (t *Transport) doDial(
 
        // The error channel needs to be buffered, as the run loop will continue running
        // after doDial returns (if the handshake is successful).
+       // Similarly, the recreateChan needs to be buffered; in case a different case is selected.
        errChan := make(chan error, 1)
-       recreateChan := make(chan errCloseForRecreating)
+       recreateChan := make(chan errCloseForRecreating, 1)
        go func() {
                err := conn.run()
                var recreateErr *errCloseForRecreating