summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-08 14:56:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-08 14:56:21 (GMT)
commite6cdfb98357c9e6631e686409b6220dae3a5ec43 (patch)
tree102af4fd6dcc8f42d3fe5e48816e9ff290508ce9 /generic
parentcdecc6d50946d64936ade03c2384bf0361e9156e (diff)
parent607e3a5ba3c721c845b29c89db243882f25c5ba5 (diff)
downloadtcl-e6cdfb98357c9e6631e686409b6220dae3a5ec43.zip
tcl-e6cdfb98357c9e6631e686409b6220dae3a5ec43.tar.gz
tcl-e6cdfb98357c9e6631e686409b6220dae3a5ec43.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/tclTest.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 3d64992..dcd86db 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -97,8 +97,7 @@ typedef struct TcpState TcpState;
struct TcpState {
Tcl_Channel channel; /* Channel associated with this socket. */
- int testFlags; /* bit field for tests. Is set by testsocket
- * test procedure */
+ int flags; /* ORed combination of various bitfields. */
};
TCL_DECLARE_MUTEX(asyncTestMutex)
@@ -6481,6 +6480,10 @@ TestChannelEventCmd(
*----------------------------------------------------------------------
*/
+#define TCP_ASYNC_TEST_MODE (1<<8) /* Async testing activated. Do not
+ * automatically continue connection
+ * process. */
+
static int
TestSocketCmd(
TCL_UNUSED(void *),
@@ -6502,6 +6505,7 @@ TestSocketCmd(
if ((cmdName[0] == 't') && (strncmp(cmdName, "testflags", len) == 0)) {
Tcl_Channel hChannel;
int modePtr;
+ int testMode;
TcpState *statePtr;
/* Set test value in the socket driver
*/
@@ -6523,7 +6527,14 @@ TestSocketCmd(
NULL);
return TCL_ERROR;
}
- statePtr->testFlags = atoi(argv[3]);
+ if (Tcl_GetBoolean(interp, argv[3], &testMode) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (testMode) {
+ statePtr->flags |= TCP_ASYNC_TEST_MODE;
+ } else {
+ statePtr->flags &= ~TCP_ASYNC_TEST_MODE;
+ }
return TCL_OK;
}