Index: generic/tlsIO.c ================================================================== --- generic/tlsIO.c +++ generic/tlsIO.c @@ -24,11 +24,11 @@ *------------------------------------------------------------------- * * TlsBlockModeProc -- * * This procedure is invoked by the generic IO level - * to set blocking and nonblocking modes + * to set channel to blocking or nonblocking mode. * * Results: * 0 if successful or POSIX error code if failed. * * Side effects: @@ -74,10 +74,20 @@ Tls_Clean(statePtr); Tcl_EventuallyFree((ClientData)statePtr, Tls_Free); return 0; } +/* + *------------------------------------------------------------------- + * + * TlsClose2Proc -- + * + * Similar to TlsCloseProc, but allows for separate close read and + * write side of channel. + * + *------------------------------------------------------------------- + */ static int TlsClose2Proc(ClientData instanceData, /* The socket state. */ Tcl_Interp *interp, /* For errors - can be NULL. */ int flags) /* Flags to close read and/or write side of channel */ { State *statePtr = (State *) instanceData; @@ -93,10 +103,12 @@ /* *------------------------------------------------------* * * Tls_WaitForConnect -- * + * Perform connect (client) or accept (server) + * * Result: * 0 if successful, -1 if failed. * * Side effects: * Issues SSL_accept or SSL_connect @@ -103,11 +115,11 @@ * *------------------------------------------------------* */ int Tls_WaitForConnect(State *statePtr, int *errorCodePtr, int handshakeFailureIsPermanent) { unsigned long backingError; - int err, rc; + int err, rc = 0; int bioShouldRetry; *errorCodePtr = 0; dprintf("WaitForConnect(%p)", (void *) statePtr); dprintFlags(statePtr); @@ -700,11 +712,11 @@ /* *------------------------------------------------------------------- * * Tls_GetParent -- * - * Get parent for stacked channel. + * Get parent channel for a stacked channel. * * Results: * Tcl_Channel or NULL if none. * *------------------------------------------------------------------- @@ -722,12 +734,11 @@ /* *------------------------------------------------------------------- * * TlsSetOptionProc -- * - * Sets an option value for a SSL socket based channel, or a - * list of all options and their values. + * Sets an option value for a SSL socket based channel. * * Results: * TCL_OK if successful or TCL_ERROR if failed. * * Side effects: @@ -749,15 +760,10 @@ dprintf("Called"); setOptionProc = Tcl_ChannelSetOptionProc(Tcl_GetChannelType(downChan)); if (setOptionProc != NULL) { return (*setOptionProc)(Tcl_GetChannelInstanceData(downChan), interp, optionName, optionValue); - } else if (optionName == (char*) NULL) { - /* - * Request is query for all options, this is ok. - */ - return TCL_OK; } /* * Request for a specific option has to fail, we don't have any. */ return Tcl_BadChannelOption(interp, optionName, ""); @@ -858,11 +864,12 @@ /* *------------------------------------------------------------------- * * TlsWatchProc -- * - * Initialize the notifier to watch Tcl_Files from this channel. + * Initialize the event notifier to watch for events of interest + * from this channel. * * Results: * None. * * Side effects: @@ -939,12 +946,12 @@ /* *------------------------------------------------------------------- * * TlsGetHandleProc -- * - * Called from Tcl_GetChannelFile to retrieve o/s file handler - * from the SSL socket based channel. + * This procedure is invoked by the generic IO level to retrieve a + * device-specific handle from the SSL socket based channel. * * Results: * The appropriate Tcl_File handle or NULL if none. * * Side effects: @@ -964,12 +971,14 @@ /* *------------------------------------------------------------------- * * TlsNotifyProc -- * - * Handler called by Tcl to inform us of activity - * on the underlying channel. + * This procedure is invoked by the generic IO level to notify the + * channel that an event occurred. It is used by stacked channel + * drivers that wish to be notified of events that occur on the + * underlying (stacked) channel. * * Results: * Type of event or 0 if failed * * Side effects: