* $Id$\r
*/\r
\r
-#ifndef IBSPDEBUG_H\r
-#define IBSPDEBUG_H\r
+#ifndef _IBSP_DEBUG_H_\r
+#define _IBSP_DEBUG_H_\r
+\r
\r
#include "ibspdll.h"\r
#include <complib/cl_atomic.h>\r
\r
#ifdef IBSP_LOGGING\r
\r
-typedef struct DataLogger\r
+typedef struct _DataLogger\r
{\r
char *BufferStart;\r
size_t TotalSize;\r
BOOL ShutdownClosed;\r
HANDLE hMapFile;\r
\r
-}DataLogger;\r
+} DataLogger;\r
\r
\r
VOID DataLogger_Init(\r
DataLogger *pLoger );\r
\r
#endif /* IBSP_LOGGING */\r
-#endif /* IBSPDEBUG_H */\r
+\r
+#endif /* _IBSP_DEBUG_H_ */\r
char *calling_func,\r
int line,\r
struct ibsp_socket_info *s,\r
- enum ibsp_socket_state new_state );\r
+ enum ibsp_socket_state new_state )\r
+{\r
+ enum ibsp_socket_state old_state;\r
+\r
+ UNUSED_PARAM( calling_func );\r
+ UNUSED_PARAM( line );\r
+\r
+ old_state = s->socket_state;\r
+\r
+ if( old_state == new_state )\r
+ {\r
+ /* Nothing to change */\r
+ return;\r
+ }\r
+\r
+ /* IBSP_CLOSED is a dead end state */\r
+ if( old_state == IBSP_CLOSED )\r
+ {\r
+ fzprint(("%s():0x%x:0x%x: socket=0x%p cannot change from %s to %s, called by %s():%d\n", __FUNCTION__, GetCurrentProcessId(), GetCurrentThreadId(), s, IBSP_SOCKET_STATE_STR(old_state), IBSP_SOCKET_STATE_STR(new_state), calling_func, line));\r
+ return;\r
+ }\r
+\r
+ fzprint(("%s():0x%x:0x%x: socket=0x%p %s to %s, called by %s():%d\n", __FUNCTION__,\r
+ GetCurrentProcessId(),\r
+ GetCurrentThreadId(), s,\r
+ IBSP_SOCKET_STATE_STR(old_state),\r
+ IBSP_SOCKET_STATE_STR(new_state), calling_func, line));\r
+\r
+ s->socket_state = new_state;\r
+}\r
\r
#define IBSP_CHANGE_SOCKET_STATE(socket_info, new_state) \\r
ibsp_css(__FUNCTION__, __LINE__, socket_info, new_state)\r