aio: Fix eventloop and eof for ssl connections
commit90669224d718ec875d83df47694370d1cc6ccf23
authorSteve Bennett <steveb@workware.net.au>
Sat, 2 May 2020 06:37:46 +0000 (2 16:37 +1000)
committerSteve Bennett <steveb@workware.net.au>
Wed, 6 May 2020 01:22:52 +0000 (6 11:22 +1000)
tree6552ff10b29e41ea9ef2f566e6d558ca6508d6a6
parentf8be02f204b55daaee5304e8ee99294612b29737
aio: Fix eventloop and eof for ssl connections

We can't use feof() and 'buffering none' on ssl connections.
Instead we have to get eof from the ssl layer, and provide
special handling for buffering in the eventloop.

For eof, add ssl_eof() and detect SSL_read() results that indicate
eof to set AIO_EOF in flags.

For buffering, add 'read -pending' that will read, and then immediately
read any buffered data so that the 'readable' event will trigger next
time.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
jim-aio.c
jim_tcl.txt
tests/aio.test
tests/ssl.test