aboutsummaryrefslogtreecommitdiff
path: root/tests/aio.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-05-02 16:37:46 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-06 11:22:52 +1000
commit90669224d718ec875d83df47694370d1cc6ccf23 (patch)
tree6552ff10b29e41ea9ef2f566e6d558ca6508d6a6 /tests/aio.test
parentf8be02f204b55daaee5304e8ee99294612b29737 (diff)
downloadjimtcl-90669224d718ec875d83df47694370d1cc6ccf23.zip
jimtcl-90669224d718ec875d83df47694370d1cc6ccf23.tar.gz
jimtcl-90669224d718ec875d83df47694370d1cc6ccf23.tar.bz2
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>
Diffstat (limited to 'tests/aio.test')
-rw-r--r--tests/aio.test8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/aio.test b/tests/aio.test
index 501b9a6..361acdc 100644
--- a/tests/aio.test
+++ b/tests/aio.test
@@ -58,7 +58,7 @@ test aio-1.9 {seek bad pos} -body {
test aio-2.1 {read usage} -body {
$f read -nonoption
-} -returnCodes error -result {expected integer but got "-nonoption"}
+} -returnCodes error -result {bad option "-nonoption": must be -nonewline, or -pending}
test aio-2.2 {read usage} -body {
$f read badint
@@ -70,7 +70,11 @@ test aio-2.3 {read -ve len} -body {
test aio-2.4 {read too many args} -body {
$f read 20 extra
-} -returnCodes error -match glob -result {wrong # args: should be "* read ?-nonewline? ?len?"}
+} -returnCodes error -match glob -result {wrong # args: should be "* read ?-nonewline|-pending|len?"}
+
+test aio-2.5 {read -pending on non-ssl} -body {
+ $f read -pending
+} -returnCodes error -result {-pending not supported on this connection type}
test aio-3.1 {copy to invalid fh} -body {
$f copy lambda