• Brad Fitzpatrick's avatar
    net/http: fix Transport crash when abandoning dial which upgrades protos · 70ee5252
    Brad Fitzpatrick authored
    When the Transport was creating an bound HTTP connection (protocol
    unknown initially) and then ends up deciding it doesn't need it, a
    goroutine sits around to clean up whatever the result was. That
    goroutine made the false assumption that the result was always an
    HTTP/1 connection or an error. It may also be an alternate protocol
    in which case the *persistConn.conn net.Conn field is nil, and the
    alt field is non-nil.
    
    Fixes #13839
    
    Change-Id: Ia4972e5eb1ad53fa00410b3466d4129c753e0871
    Reviewed-on: https://go-review.googlesource.com/18573Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    70ee5252
export_test.go 3.52 KB