Diff

Differences From Artifact [e135f89793]:

To Artifact [f8c02fc8c8]:


61
62
63
64
65
66
67

68
69
70
71
72
73
74
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75







+








	if (statePtr == NULL) {
		dprintf("Asked to setup a NULL state, just creating the initial configuration");

		return(NULL);
	}

#ifdef TCLTLS_SSL_USE_FASTPATH
	/*
	 * If the channel can be mapped back to a file descriptor, just use the file descriptor
	 * with the SSL library since it will likely be optimized for this.
	 */
	parentChannel = Tls_GetParent(statePtr);
	parentChannelType = Tcl_GetChannelType(parentChannel);

89
90
91
92
93
94
95


96
97
98
99
100
101








102
103
104
105
106
107
108
109
90
91
92
93
94
95
96
97
98






99
100
101
102
103
104
105
106

107
108
109
110
111
112
113







+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-







			}
		}
	}

	if (validParentChannelFd) {
		dprintf("We found a shortcut, this channel is backed by a file descriptor: %i", parentChannelFdIn);
		bio = BIO_new_socket(parentChannelFd, flags);
		return(bio);
	}
	} else {
		dprintf("Falling back to Tcl I/O for this channel");
		bio = BIO_new(BioMethods);
		BIO_set_data(bio, statePtr);
		BIO_set_shutdown(bio, flags);
		BIO_set_init(bio, 1);

	dprintf("Falling back to Tcl I/O for this channel");
#endif

	bio = BIO_new(BioMethods);
	BIO_set_data(bio, statePtr);
	BIO_set_shutdown(bio, flags);
	BIO_set_init(bio, 1);
	}

	return(bio);
}

static int BioWrite(BIO *bio, CONST char *buf, int bufLen) {
	Tcl_Channel chan;
	int ret;