server: use proper \r\n terminator

previously I just read until some data was read
This commit is contained in:
nixo 2020-10-25 00:00:46 +02:00
parent eef996857d
commit 1dc60fd103
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,8 @@ function handle_connection(f, server, context, io, verbose)
# verbose && println("init_finished")
# TODO: add a timeout!
while isopen(server) && isopen(io) &&
(length(content) == 0 || bytesavailable(client.sock) > 0)
(length(client.context.data) < 2 ||
client.context.data[end-1:end] != UInt8['\r', '\n'])
# println("HERE")
OpenSSL.do_sock_read(client)
end