diff options
Diffstat (limited to 'ndb/include')
-rw-r--r-- | ndb/include/portlib/NdbTCP.h | 12 | ||||
-rw-r--r-- | ndb/include/util/SocketServer.hpp | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 8138a2ef354..308a3833ffd 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -31,7 +31,7 @@ #define NDB_NONBLOCK FNDELAY #define NDB_SOCKET_TYPE int #define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) +#define _NDB_CLOSE_SOCKET(x) close(x) /** * socklen_t not defined in the header files of OSE @@ -52,7 +52,7 @@ typedef int socklen_t; #define EWOULDBLOCK WSAEWOULDBLOCK #define NDB_SOCKET_TYPE SOCKET #define NDB_INVALID_SOCKET INVALID_SOCKET -#define NDB_CLOSE_SOCKET(x) closesocket(x) +#define _NDB_CLOSE_SOCKET(x) closesocket(x) #else @@ -64,7 +64,7 @@ typedef int socklen_t; #define NDB_NONBLOCK O_NONBLOCK #define NDB_SOCKET_TYPE int #define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) ::close(x) +#define _NDB_CLOSE_SOCKET(x) ::close(x) #define InetErrno errno @@ -89,6 +89,12 @@ extern "C" { */ int Ndb_getInAddr(struct in_addr * dst, const char *address); +#ifdef DBUG_OFF +#define NDB_CLOSE_SOCKET(fd) _NDB_CLOSE_SOCKET(fd) +#else +int NDB_CLOSE_SOCKET(int fd); +#endif + #ifdef __cplusplus } #endif diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index 9d8af204391..ee2dd31c41f 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -41,7 +41,13 @@ public: protected: friend class SocketServer; friend void* sessionThread_C(void*); - Session(NDB_SOCKET_TYPE sock): m_socket(sock){ m_stop = m_stopped = false;} + Session(NDB_SOCKET_TYPE sock): m_socket(sock) + { + DBUG_ENTER("SocketServer::Session"); + DBUG_PRINT("enter",("NDB_SOCKET: %d", m_socket)); + m_stop = m_stopped = false; + DBUG_VOID_RETURN; + } bool m_stop; // Has the session been ordered to stop? bool m_stopped; // Has the session stopped? |