From eef996857d737e6cb57f6b8d9cb37cf7db0451fa Mon Sep 17 00:00:00 2001 From: nixo Date: Sun, 25 Oct 2020 00:00:03 +0200 Subject: [PATCH] let SSLClient store received data --- src/server.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server.jl b/src/server.jl index 32dfdf2..4dfd34d 100644 --- a/src/server.jl +++ b/src/server.jl @@ -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