Check-in [689d55e070]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed an issue where EAGAIN was translated into a successful handshake, addressing [1367823d51]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:689d55e070bc4c9a56fab35927486bc1ae666acd
User & Date: rkeene 2017-05-01 14:41:48
References
2017-05-01
14:44 Fixed ticket [1367823d51]: async tls::handshake returns 1 before handshake is complete plus 5 other changes artifact: 118749a900 user: rkeene
Context
2017-05-01
14:42
Print a debug message when handshaking works but an error is being captured check-in: 87d7c791f5 user: rkeene tags: trunk
14:41
Fixed an issue where EAGAIN was translated into a successful handshake, addressing [1367823d51] check-in: 689d55e070 user: rkeene tags: trunk
14:32
Reformatted handshake command code check-in: 2893572aa6 user: rkeene tags: trunk
Changes

Changes to tls.c.

   655    655   	}
   656    656   	statePtr = (State *)Tcl_GetChannelInstanceData(chan);
   657    657   
   658    658   	dprintf("Calling Tls_WaitForConnect");
   659    659   	ret = Tls_WaitForConnect(statePtr, &err, 1);
   660    660   	dprintf("Tls_WaitForConnect returned: %i", ret);
   661    661   
   662         -	if (ret < 0) {
   663         -		if ((statePtr->flags & TLS_TCL_ASYNC) && err == EAGAIN) {
   664         -			dprintf("Async set and err = EAGAIN");
   665         -			ret = 0;
   666         -		}
   667         -	}
   668         -
   669         -	if (ret < 0) {
          662  +	if (
          663  +	    ret < 0 && \
          664  +	    ((statePtr->flags & TLS_TCL_ASYNC) && err == EAGAIN)
          665  +	) {
          666  +		dprintf("Async set and err = EAGAIN");
          667  +		ret = 0;
          668  +	} else if (ret < 0) {
   670    669   		errStr = statePtr->err;
   671    670   		Tcl_ResetResult(interp);
   672    671   		Tcl_SetErrno(err);
   673    672   
   674    673   		if (!errStr || *errStr == 0) {
   675    674   			errStr = Tcl_PosixError(interp);
   676    675   		}