Implement suggestions from @dom96

This commit is contained in:
Dmitry Polienko 2016-11-02 09:19:20 +07:00
commit 4753149227
2 changed files with 19 additions and 20 deletions

View file

@ -133,9 +133,9 @@ proc processClient(client: AsyncSocket, address: string,
assert client != nil
request.client = client
# We should skip empty lines before the request
# We should skip at least one empty line before the request
# https://tools.ietf.org/html/rfc7230#section-3.5
while true:
for i in 0..1:
lineFut.mget().setLen(0)
lineFut.clean()
await client.recvLineInto(lineFut) # TODO: Timeouts.