summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r--win/tclWinSock.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 2703309..d6c8e3a 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -133,6 +133,8 @@ typedef struct TcpFdList {
struct TcpState {
Tcl_Channel channel; /* Channel associated with this socket. */
+ int testFlags; /* bit field for tests. Is set by testsocket
+ * test procedure */
struct TcpFdList *sockets; /* Windows SOCKET handle. */
int flags; /* Bit field comprised of the flags described
* below. */
@@ -191,7 +193,13 @@ struct TcpState {
* flag indicates that reentry is
* still pending */
#define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */
-#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated
+
+/*
+ * These bits may be ORed together into the "testFlags" field of a TcpState
+ * structure.
+ */
+
+#define TCP_ASYNC_TEST_MODE (1<<0) /* Async testing activated
* Do not automatically continue connection
* process */
@@ -612,7 +620,7 @@ WaitForConnect(
* - Call by the event queue (errorCodePtr == NULL)
*/
- if ( (statePtr->flags & TCP_ASYNC_TEST_MODE)
+ if ( (statePtr->testFlags & TCP_ASYNC_TEST_MODE)
&& errorCodePtr != NULL && (statePtr->flags & TCP_NONBLOCKING)) {
*errorCodePtr = EWOULDBLOCK;
return -1;
@@ -1140,7 +1148,6 @@ TcpSetOptionProc(
const char *optionName, /* Name of the option to set. */
const char *value) /* New value for option. */
{
- TcpState *statePtr = instanceData;
#ifdef TCL_FEATURE_KEEPALIVE_NAGLE
TcpState *statePtr = instanceData;
SOCKET sock;
@@ -1160,22 +1167,6 @@ TcpSetOptionProc(
return TCL_ERROR;
}
- /*
- * Set socket test int value
- */
- if (!strcmp(optionName, "-unsupported1")) {
- int intValue;
- if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) {
- return TCL_ERROR;
- }
- if (intValue & 1) {
- SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE);
- } else {
- CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE);
- }
- return TCL_OK;
- }
-
#ifdef TCL_FEATURE_KEEPALIVE_NAGLE
#error "TCL_FEATURE_KEEPALIVE_NAGLE not reviewed for whether to treat statePtr->sockets as single fd or list"
sock = statePtr->sockets->fd;
@@ -1288,7 +1279,7 @@ TcpGetOptionProc(
* Go one step in async connect
* If any error is thrown save it as backround error to report eventually below
*/
- if (! (statePtr->flags & TCP_ASYNC_TEST_MODE) ) {
+ if (! (statePtr->testFlags & TCP_ASYNC_TEST_MODE) ) {
WaitForConnect(statePtr, NULL);
}