Index: tls.c ================================================================== --- tls.c +++ tls.c @@ -371,11 +371,11 @@ dprintf("Called"); if (msg && *msg) { Tcl_SetErrorCode(statePtr->interp, "SSL", msg, (char *)NULL); } else { - msg = Tcl_GetStringFromObj(Tcl_GetObjResult(statePtr->interp), (Tcl_Size *)NULL); + msg = Tcl_GetString(Tcl_GetObjResult(statePtr->interp)); } statePtr->err = msg; if (statePtr->callback == (Tcl_Obj*)NULL) { char buf[BUFSIZ]; @@ -653,11 +653,11 @@ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channel"); return(TCL_ERROR); } - chan = Tcl_GetChannel(interp, Tcl_GetStringFromObj(objv[1], (Tcl_Size *)NULL), NULL); + chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL); if (chan == (Tcl_Channel) NULL) { return(TCL_ERROR); } /* @@ -784,11 +784,11 @@ if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "channel ?options?"); return TCL_ERROR; } - chan = Tcl_GetChannel(interp, Tcl_GetStringFromObj(objv[1], (Tcl_Size *) NULL), NULL); + chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } /* @@ -795,11 +795,11 @@ * Make sure to operate on the topmost channel */ chan = Tcl_GetTopChannel(chan); for (idx = 2; idx < objc; idx++) { - char *opt = Tcl_GetStringFromObj(objv[idx], (Tcl_Size *)NULL); + char *opt = Tcl_GetString(objv[idx]); if (opt[0] != '-') break; OPTSTR( "-cadir", CAdir); @@ -1418,16 +1418,16 @@ dprintf("Called"); switch (objc) { case 2: - channelName = Tcl_GetStringFromObj(objv[1], (Tcl_Size *) NULL); + channelName = Tcl_GetString(objv[1]); break; case 3: if (!strcmp (Tcl_GetString (objv[1]), "-local")) { - channelName = Tcl_GetStringFromObj(objv[2], (Tcl_Size *)NULL); + channelName = Tcl_GetString(objv[2]); break; } /* else fall... */ default: Tcl_WrongNumArgs(interp, 1, objv, "?-local? channel"); @@ -1778,11 +1778,11 @@ * create the ssl command, initialise ssl context * *------------------------------------------------------------------- */ -int DLLEXPORT Tls_Init(Tcl_Interp *interp) { +DLLEXPORT int Tls_Init(Tcl_Interp *interp) { const char tlsTclInitScript[] = { #include "tls.tcl.h" 0x00 }; @@ -1791,13 +1791,13 @@ /* * We only support Tcl 8.4 or newer */ if ( #ifdef USE_TCL_STUBS - Tcl_InitStubs(interp, "8.4", 0) + Tcl_InitStubs(interp, "8.6-", 0) #else - Tcl_PkgRequire(interp, "Tcl", "8.4-", 0) + Tcl_PkgRequire(interp, "Tcl", "8.6-", 0) #endif == NULL) { return TCL_ERROR; } @@ -1838,11 +1838,11 @@ * A standard Tcl error code. * *------------------------------------------------------* */ -int DLLEXPORT Tls_SafeInit(Tcl_Interp *interp) { +DLLEXPORT int Tls_SafeInit(Tcl_Interp *interp) { dprintf("Called"); return(Tls_Init(interp)); } /* Index: tls.h ================================================================== --- tls.h +++ tls.h @@ -21,9 +21,9 @@ #include /* * Initialization routines -- our entire public C API. */ -int DLLEXPORT Tls_Init(Tcl_Interp *interp); -int DLLEXPORT Tls_SafeInit(Tcl_Interp *interp); +DLLEXPORT int Tls_Init(Tcl_Interp *interp); +DLLEXPORT int Tls_SafeInit(Tcl_Interp *interp); #endif /* _TLS_H */ Index: tlsIO.c ================================================================== --- tlsIO.c +++ tlsIO.c @@ -17,11 +17,10 @@ * */ #include "tlsInt.h" - /* * Forward declarations */ static int TlsBlockModeProc (ClientData instanceData, int mode); #if TCL_MAJOR_VERSION < 9 @@ -83,11 +82,11 @@ * against an older variant. */ size = sizeof(Tcl_ChannelType); /* Base size */ tlsChannelType = (Tcl_ChannelType *) ckalloc(size); - memset((void *) tlsChannelType, 0, size); + memset(tlsChannelType, 0, size); /* * Common elements of the structure (no changes in location or name) * close2Proc, seekProc, setOptionProc stay NULL. */ @@ -849,16 +848,17 @@ return 0; } dprintf("Calling Tls_WaitForConnect"); errorCode = 0; - if (Tls_WaitForConnect(statePtr, &errorCode, 1) < 0) { if (errorCode == EAGAIN) { dprintf("Async flag could be set (didn't check) and errorCode == EAGAIN: Returning 0"); + return 0; } + dprintf("Tls_WaitForConnect returned an error"); } dprintf("Returning %i", mask);