Clear deadlines set by HTTP server.

This commit is contained in:
Gary Burd 2014-06-29 19:47:15 -07:00
parent bc19d3d337
commit 3d0e89148e
1 changed files with 3 additions and 0 deletions

View File

@ -184,6 +184,9 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
}
p = append(p, "\r\n"...)
// Clear deadlines set by HTTP server.
netConn.SetDeadline(time.Time{})
if u.HandshakeTimeout > 0 {
netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout))
}