Commit 915126bb authored by Kunpei Sakai's avatar Kunpei Sakai Committed by Tom Bergan

net/http: make startBackgroundRead panic if hijacked

Fixes #20933

Change-Id: I827c8d265674a7448c51c1da991e9b3b4501ba11
Reviewed-on: https://go-review.googlesource.com/59850
Run-TryBot: Tom Bergan <tombergan@google.com>
Reviewed-by: default avatarTom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 074547a5
......@@ -729,6 +729,9 @@ func (cr *connReader) Read(p []byte) (n int, err error) {
cr.lock()
if cr.inRead {
cr.unlock()
if cr.conn.hijacked() {
panic("invalid Body.Read call. After hijacked, the original Request must not be used")
}
panic("invalid concurrent Body.Read call")
}
if cr.hitReadLimit() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment