let SSLClient store received data

master
nixo 2020-10-25 00:00:03 +02:00
parent ba05db91fe
commit eef996857d
1 changed files with 2 additions and 4 deletions

View File

@ -58,9 +58,6 @@ function handle_connection(f, server, context, io, verbose)
client = SSLClient(context, io)
while isopen(server) && isopen(io)
try
content = UInt8[]
client.io_on_read = (x) -> append!(content, x)
(ip, client_port) = Sockets.getpeername(io)
while true
if isreadable(io) && length(client.write_buf) == 0
# verbose && println("do_read")
@ -83,7 +80,8 @@ function handle_connection(f, server, context, io, verbose)
# println("HERE")
OpenSSL.do_sock_read(client)
end
f(Connection(server, client), Request(String(content)))
f(Connection(server, client),
Request(String(client.context.data)))
break
end
end