finally write close_notify correctly

master
Nicolò Balzarotti 2020-11-14 13:35:58 +01:00
parent b02b8571a0
commit 2dfaf6a275
1 changed files with 4 additions and 4 deletions

View File

@ -138,20 +138,20 @@ function do_ssl_shutdown(client)
@show status = ssl_status(client, n)
end
if status in (SSL_WANT_READ, SSL_WANT_WRITE)
@info "READING"
while true
(n, buf) = bio_read(client)
println("bio_read: $(n)")
if n > 0
queue_encrypted_bytes(client, buf)
elseif !bio_should_retry(client.wbio)
return -1
else
res = do_sock_write(client)
# TODO: Check res?
break
end
end
end
@show ssl_status(client, shutdown(client))
# println("End of ssl handshake")
# Here, ssl_status(client, shutdown(client))
# still want read .-.,,
return status
end