mirror of
https://github.com/zhigang1992/cow.git
synced 2026-05-03 19:55:48 +08:00
Extract (*Request).hasSent
This commit is contained in:
4
http.go
4
http.go
@@ -116,6 +116,10 @@ func (r *Request) responseNotSent() bool {
|
||||
return r.state <= rsSent
|
||||
}
|
||||
|
||||
func (r *Request) hasSent() bool {
|
||||
return r.state >= rsSent
|
||||
}
|
||||
|
||||
func (r *Request) releaseBuf() {
|
||||
if r.raw != nil {
|
||||
httpBuf.Put(r.rawByte)
|
||||
|
||||
2
proxy.go
2
proxy.go
@@ -367,7 +367,7 @@ func (c *clientConn) serve() {
|
||||
sv.Close()
|
||||
if c.shouldRetry(&r, sv, err) {
|
||||
goto retry
|
||||
} else if err == errPageSent && (!r.hasBody() || r.state >= rsSent) {
|
||||
} else if err == errPageSent && (!r.hasBody() || r.hasSent()) {
|
||||
// Can only continue if request has no body, or request body
|
||||
// has been read.
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user