diff options
author | max <max@tclers.tk> | 2014-03-05 13:09:22 (GMT) |
---|---|---|
committer | max <max@tclers.tk> | 2014-03-05 13:09:22 (GMT) |
commit | 60f72ecdaf9f585eb8210a95d43969c20ede5329 (patch) | |
tree | 646884038943cc46f9137c98300f2b589af65daa | |
parent | 91e8a8f60c91ad11df3a1c00d36184b9bc0c9947 (diff) | |
download | tcl-60f72ecdaf9f585eb8210a95d43969c20ede5329.zip tcl-60f72ecdaf9f585eb8210a95d43969c20ede5329.tar.gz tcl-60f72ecdaf9f585eb8210a95d43969c20ede5329.tar.bz2 |
Print out the value of infoPtr in DEBUG, so that coexisting sockets can be distinguished in the output.
-rw-r--r-- | win/tclWinSock.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 2da50f5..64b2fc9 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -49,7 +49,8 @@ #define DEBUGGING #ifdef DEBUGGING -#define DEBUG(x) fprintf(stderr, ">>> %s(%d): %s<<<\n", __FUNCTION__, __LINE__, x) +#define DEBUG(x) fprintf(stderr, ">>> %p %s(%d): %s<<<\n", \ + infoPtr, __FUNCTION__, __LINE__, x) #else #define DEBUG(x) #endif @@ -669,7 +670,6 @@ SocketCheckProc( SocketEvent *evPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - DEBUG("A"); if (!(flags & TCL_FILE_EVENTS)) { return; } @@ -683,10 +683,12 @@ SocketCheckProc( WaitForSingleObject(tsdPtr->socketListLock, INFINITE); for (infoPtr = tsdPtr->socketList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { + DEBUG("A"); if ((infoPtr->readyEvents & (infoPtr->watchEvents | FD_CONNECT | FD_ACCEPT)) && !(infoPtr->flags & SOCKET_PENDING) ) { + DEBUG("B"); infoPtr->flags |= SOCKET_PENDING; evPtr = ckalloc(sizeof(SocketEvent)); evPtr->header.proc = SocketEventProc; @@ -1356,6 +1358,7 @@ WaitForSocketEvent( /* * Be sure to disable event servicing so we are truly modal. */ + DEBUG("============="); oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); @@ -2586,12 +2589,10 @@ SocketProc( switch (message) { default: - DEBUG("default"); return DefWindowProc(hwnd, message, wParam, lParam); break; case WM_CREATE: - DEBUG("CREATE"); /* * Store the initial tsdPtr, it's from a different thread, so it's not * directly accessible, but needed. @@ -2607,12 +2608,10 @@ SocketProc( break; case WM_DESTROY: - DEBUG("DESTROY"); PostQuitMessage(0); break; case SOCKET_MESSAGE: - DEBUG("SOCKET_MESSAGE"); event = WSAGETSELECTEVENT(lParam); error = WSAGETSELECTERROR(lParam); socket = (SOCKET) wParam; @@ -2668,7 +2667,6 @@ SocketProc( * Remember any error that occurred so we can report * connection failures. */ - if (error != ERROR_SUCCESS) { TclWinConvertError((DWORD) error); infoPtr->lastError = Tcl_GetErrno(); |