Commit 66fccd82 authored by unknown's avatar unknown
Browse files

added debug prints


ndb/include/portlib/NdbTCP.h:
  added debug prints
ndb/include/util/SocketServer.hpp:
  added debug prints
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  debug prints
ndb/src/common/mgmcommon/IPCConfig.cpp:
  debug prints
ndb/src/common/portlib/NdbMutex.c:
  debug prints
ndb/src/common/portlib/NdbTCP.cpp:
  debug printout
ndb/src/common/portlib/NdbThread.c:
  debug printout
ndb/src/common/transporter/TransporterRegistry.cpp:
  debug printout
ndb/src/common/util/Parser.cpp:
  debug printout
ndb/src/common/util/SocketClient.cpp:
  debug printout
ndb/src/common/util/SocketServer.cpp:
  debug printout
parent 96dcb8c2
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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
+7 −1
Original line number Diff line number Diff line
@@ -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?
+7 −2
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@
ConfigRetriever::ConfigRetriever(const char * _connect_string,
				 Uint32 version, Uint32 node_type)
{
  DBUG_ENTER("ConfigRetriever::ConfigRetriever");

  m_version = version;
  m_node_type = node_type;
  _ownNodeId= 0;
@@ -55,23 +57,26 @@ ConfigRetriever::ConfigRetriever(const char * _connect_string,

  if (m_handle == 0) {
    setError(CR_ERROR, "Unable to allocate mgm handle");
    return;
    DBUG_VOID_RETURN;
  }

  if (ndb_mgm_set_connectstring(m_handle, _connect_string))
  {
    setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle));
    return;
    DBUG_VOID_RETURN;
  }
  resetError();
  DBUG_VOID_RETURN;
}

ConfigRetriever::~ConfigRetriever()
{
  DBUG_ENTER("ConfigRetriever::~ConfigRetriever");
  if (m_handle) {
    ndb_mgm_disconnect(m_handle);
    ndb_mgm_destroy_handle(&m_handle);
  }
  DBUG_VOID_RETURN;
}

Uint32 
+5 −2
Original line number Diff line number Diff line
@@ -114,7 +114,10 @@ IPCConfig::addRemoteNodeId(NodeId nodeId){
 * Returns no of transporters configured
 */
int
IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry)
{
  DBUG_ENTER("IPCConfig::configureTransporters");

  int noOfTransportersCreated = 0;

  Uint32 noOfConnections;
@@ -276,7 +279,7 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
      continue;
    }
  }
  return noOfTransportersCreated;
  DBUG_RETURN(noOfTransportersCreated);
}

/**
+10 −6
Original line number Diff line number Diff line
@@ -23,33 +23,37 @@

NdbMutex* NdbMutex_Create(void)
{
  DBUG_ENTER("NdbMutex_Create");
  NdbMutex* pNdbMutex;
  int result;
  
  pNdbMutex = (NdbMutex*)NdbMem_Allocate(sizeof(NdbMutex));
  DBUG_PRINT("info",("NdbMem_Allocate 0x%lx",pNdbMutex));
  
  if (pNdbMutex == NULL)
    return NULL;
    DBUG_RETURN(NULL);
  
  result = pthread_mutex_init(pNdbMutex, NULL);
  assert(result == 0);
			     
  return pNdbMutex;
		     
  DBUG_RETURN(pNdbMutex);		     
}


int NdbMutex_Destroy(NdbMutex* p_mutex)
{
  DBUG_ENTER("NdbMutex_Destroy");
  int result;

  if (p_mutex == NULL)
    return -1;
    DBUG_RETURN(-1);

  result = pthread_mutex_destroy(p_mutex);
  free(p_mutex);

  return result;
  DBUG_PRINT("info",("NdbMem_Free 0x%lx",p_mutex));
  NdbMem_Free(p_mutex);
			     
  DBUG_RETURN(result);

}

Loading