• Brad Fitzpatrick's avatar
    http2: fix Transport.RoundTrip hang on stream error before headers · e2ba55e4
    Brad Fitzpatrick authored
    If the Transport got a stream error on the response headers, it was
    never unblocking the client. Previously, Response.Body reads would be
    aborted with the stream error, but RoundTrip itself would never
    unblock.
    
    The Transport now also sends a RST_STREAM to the server when we
    encounter a stream error.
    
    Also, add a "Cause" field to StreamError with additional detail. The
    old code was just returning the detail, without the stream error
    header.
    
    Fixes golang/go#16572
    
    Change-Id: Ibecedb5779f17bf98c32787b68eb8a9b850833b3
    Reviewed-on: https://go-review.googlesource.com/25402
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
    e2ba55e4
server_test.go 92.2 KB