Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -56,11 +56,11 @@ $(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)' $(INSTALL) -t '$(DESTDIR)$(PACKAGE_INSTALL_DIR)' @EXTENSION_TARGET@ pkgIndex.tcl # Test target, run the automated test suite test: @EXTENSION_TARGET@ - cd tests && @TCLSH_PROG@ all.tcl + @TCLSH_PROG@ @srcdir@/tests/all.tcl $(TESTFLAGS) -load "lappend auto_path $(shell pwd)" # Clean the local build directory for rebuild against the same configuration clean: rm -f tls.o tlsBIO.o tlsIO.o tlsX509.o rm -f tcltls.@SHOBJEXT@ Index: autogen.sh ================================================================== --- autogen.sh +++ autogen.sh @@ -67,9 +67,13 @@ else mv aclocal.m4.new aclocal.m4 fi automake --add-missing --copy --force-missing >/dev/null 2>/dev/null +if ! [ -f install-sh -o -f install.sh -o -f shtool ]; then + echo "automake failed" >&2 + exit 1 +fi autoconf rm -rf autom4te.cache Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -129,11 +129,11 @@ dnl Find "pkg-config" since we need to use it AC_CHECK_TOOL([PKGCONFIG], [pkg-config], [false]) dnl Determine if we have been asked to use a fast path if possible tcltls_ssl_fastpath='no' -AC_ARG_ENABLE([ssl-fastpath], AS_HELP_STRING([--disable-ssl-fastpath], [disable using the underlying file descriptor for talking directly to the SSL library]), [ +AC_ARG_ENABLE([ssl-fastpath], AS_HELP_STRING([--enable-ssl-fastpath], [enable using the underlying file descriptor for talking directly to the SSL library]), [ if test "$enableval" = 'yes'; then tcltls_ssl_fastpath='yes' else tcltls_ssl_fastpath='no' fi Index: tests/all.tcl ================================================================== --- tests/all.tcl +++ tests/all.tcl @@ -7,11 +7,12 @@ # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. # # RCS: @(#) $Id: all.tcl,v 1.5 2000/08/15 18:45:01 hobbs Exp $ -set auto_path [linsert $auto_path 0 [file normalize [file join [file dirname [info script]] ..]]] +#set auto_path [linsert $auto_path 0 [file normalize [file join [file dirname [info script]] ..]]] +set auto_path [linsert $auto_path 0 [file normalize [pwd]]] if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import ::tcltest::* } Index: tlsBIO.c ================================================================== --- tlsBIO.c +++ tlsBIO.c @@ -139,21 +139,18 @@ } else if (ret < 0) { dprintf("We got some kind of I/O error"); if (tclErrno == EAGAIN) { dprintf("It's EAGAIN"); - ret = 0; } else { dprintf("It's an unepxected error: %s/%i", Tcl_ErrnoMsg(tclErrno), tclErrno); - Tcl_SetErrno(ECONNRESET); - ret = -1; } } else { dprintf("Successfully wrote some data"); } - if (ret != -1) { + if (ret != -1 || (ret == -1 && tclErrno == EAGAIN)) { if (BIO_should_read(bio)) { dprintf("Setting should retry read flag"); BIO_set_retry_read(bio); } @@ -195,21 +192,18 @@ } else if (ret < 0) { dprintf("We got some kind of I/O error"); if (tclErrno == EAGAIN) { dprintf("It's EAGAIN"); - ret = 0; } else { dprintf("It's an unepxected error: %s/%i", Tcl_ErrnoMsg(tclErrno), tclErrno); - Tcl_SetErrno(ECONNRESET); - ret = -1; } } else { dprintf("Successfully read some data"); } - if (ret != -1) { + if (ret != -1 || (ret == -1 && tclErrno == EAGAIN)) { if (BIO_should_write(bio)) { dprintf("Setting should retry write flag"); BIO_set_retry_write(bio); } Index: tlsIO.c ================================================================== --- tlsIO.c +++ tlsIO.c @@ -465,10 +465,15 @@ case SSL_ERROR_ZERO_RETURN: dprintf("Got SSL_ERROR_ZERO_RETURN, this means an EOF has been reached"); bytesRead = 0; *errorCodePtr = 0; break; + case SSL_ERROR_WANT_READ: + dprintf("Got SSL_ERROR_WANT_READ, mapping this to EAGAIN"); + bytesRead = -1; + *errorCodePtr = EAGAIN; + break; default: dprintf("Unknown error (err = %i), mapping to EOF", err); *errorCodePtr = 0; bytesRead = 0; break; @@ -568,11 +573,13 @@ if (written < 0) { written = 0; } break; case SSL_ERROR_WANT_WRITE: - dprintf(" write W BLOCK"); + dprintf("Got SSL_ERROR_WANT_WRITE, mapping it to EAGAIN"); + *errorCodePtr = EAGAIN; + written = -1; break; case SSL_ERROR_WANT_READ: dprintf(" write R BLOCK"); break; case SSL_ERROR_WANT_X509_LOOKUP: