mirror of
https://github.com/golang/go.git
synced 2025-10-19 19:13:18 +00:00
net/http: check server shutting down before processing the request
This commit is contained in:
parent
5c92f43c51
commit
426099a3e7
1 changed files with 3 additions and 0 deletions
|
@ -1966,6 +1966,9 @@ func (c *conn) serve(ctx context.Context) {
|
||||||
// If we read any bytes off the wire, we're active.
|
// If we read any bytes off the wire, we're active.
|
||||||
c.setState(c.rwc, StateActive, runHooks)
|
c.setState(c.rwc, StateActive, runHooks)
|
||||||
}
|
}
|
||||||
|
if c.server.shuttingDown() {
|
||||||
|
return
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
const errorHeaders = "\r\nContent-Type: text/plain; charset=utf-8\r\nConnection: close\r\n\r\n"
|
const errorHeaders = "\r\nContent-Type: text/plain; charset=utf-8\r\nConnection: close\r\n\r\n"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue