Fix regression w/ keep-alive connections to AsyncHttpServer
We should keep listening if the connection is marked as keep-alive. Fixes #10536
This commit is contained in:
parent
59574b89a6
commit
bcb5995ddf
1 changed files with 4 additions and 1 deletions
|
|
@ -264,6 +264,9 @@ proc processRequest(
|
||||||
if "upgrade" in request.headers.getOrDefault("connection"):
|
if "upgrade" in request.headers.getOrDefault("connection"):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
# The request has been served, from this point on returning `true` means the
|
||||||
|
# connection will not be closed and will be kept in the connection pool.
|
||||||
|
|
||||||
# Persistent connections
|
# Persistent connections
|
||||||
if (request.protocol == HttpVer11 and
|
if (request.protocol == HttpVer11 and
|
||||||
cmpIgnoreCase(request.headers.getOrDefault("connection"), "close") != 0) or
|
cmpIgnoreCase(request.headers.getOrDefault("connection"), "close") != 0) or
|
||||||
|
|
@ -273,7 +276,7 @@ proc processRequest(
|
||||||
# header states otherwise.
|
# header states otherwise.
|
||||||
# In HTTP 1.0 we assume that the connection should not be persistent.
|
# In HTTP 1.0 we assume that the connection should not be persistent.
|
||||||
# Unless the connection header states otherwise.
|
# Unless the connection header states otherwise.
|
||||||
discard
|
return true
|
||||||
else:
|
else:
|
||||||
request.client.close()
|
request.client.close()
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue