Check-in [689d55e070]
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 on 2017-05-01 14:41:48
Other Links: manifest | tags
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
Modified tls.c from [325d38b6f1] to [8221535697].
655
656
657
658
659
660
661

662
663

664
665
666
667
668
669
670
671
672
673
674
675
676
	}
	statePtr = (State *)Tcl_GetChannelInstanceData(chan);

	dprintf("Calling Tls_WaitForConnect");
	ret = Tls_WaitForConnect(statePtr, &err, 1);
	dprintf("Tls_WaitForConnect returned: %i", ret);


	if (ret < 0) {
		if ((statePtr->flags & TLS_TCL_ASYNC) && err == EAGAIN) {

			dprintf("Async set and err = EAGAIN");
			ret = 0;
		}
	}

	if (ret < 0) {
		errStr = statePtr->err;
		Tcl_ResetResult(interp);
		Tcl_SetErrno(err);

		if (!errStr || *errStr == 0) {
			errStr = Tcl_PosixError(interp);
		}







>
|
|
>
|
|
<
<
<
|







655
656
657
658
659
660
661
662
663
664
665
666
667



668
669
670
671
672
673
674
675
	}
	statePtr = (State *)Tcl_GetChannelInstanceData(chan);

	dprintf("Calling Tls_WaitForConnect");
	ret = Tls_WaitForConnect(statePtr, &err, 1);
	dprintf("Tls_WaitForConnect returned: %i", ret);

	if (
	    ret < 0 && \
	    ((statePtr->flags & TLS_TCL_ASYNC) && err == EAGAIN)
	) {
		dprintf("Async set and err = EAGAIN");
		ret = 0;



	} else if (ret < 0) {
		errStr = statePtr->err;
		Tcl_ResetResult(interp);
		Tcl_SetErrno(err);

		if (!errStr || *errStr == 0) {
			errStr = Tcl_PosixError(interp);
		}