Extract (*Request).hasSent

This commit is contained in:
Chen Yufei
2013-08-06 12:31:12 +08:00
parent 9ccf4bf7be
commit ec0bace769
2 changed files with 5 additions and 1 deletions

View File

@@ -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)

View File

@@ -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