mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Use "configured" socklen_t
Fix master printout ndb/src/mgmclient/CommandInterpreter.cpp: Fix master printout ndb/src/mgmsrv/MgmtSrvr.cpp: Use "configured" socklen_t ndb/src/mgmsrv/MgmtSrvr.hpp: Use "configured" socklen_t ndb/src/mgmsrv/Services.cpp: Use "configured" socklen_t
This commit is contained in:
parent
dbd2625fd7
commit
940a6b4e3e
4 changed files with 12 additions and 4 deletions
|
@ -654,13 +654,21 @@ CommandInterpreter::executeShow(char* parameters)
|
||||||
api_nodes= 0,
|
api_nodes= 0,
|
||||||
mgm_nodes= 0;
|
mgm_nodes= 0;
|
||||||
|
|
||||||
|
for(i=0; i < state->no_of_nodes; i++) {
|
||||||
|
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_NDB &&
|
||||||
|
state->node_states[i].version != 0){
|
||||||
|
master_id= state->node_states[i].dynamic_id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0; i < state->no_of_nodes; i++) {
|
for(i=0; i < state->no_of_nodes; i++) {
|
||||||
switch(state->node_states[i].node_type) {
|
switch(state->node_states[i].node_type) {
|
||||||
case NDB_MGM_NODE_TYPE_API:
|
case NDB_MGM_NODE_TYPE_API:
|
||||||
api_nodes++;
|
api_nodes++;
|
||||||
break;
|
break;
|
||||||
case NDB_MGM_NODE_TYPE_NDB:
|
case NDB_MGM_NODE_TYPE_NDB:
|
||||||
if (state->node_states[i].dynamic_id > master_id)
|
if (state->node_states[i].dynamic_id < master_id)
|
||||||
master_id= state->node_states[i].dynamic_id;
|
master_id= state->node_states[i].dynamic_id;
|
||||||
ndb_nodes++;
|
ndb_nodes++;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2304,7 +2304,7 @@ bool
|
||||||
MgmtSrvr::alloc_node_id(NodeId * nodeId,
|
MgmtSrvr::alloc_node_id(NodeId * nodeId,
|
||||||
enum ndb_mgm_node_type type,
|
enum ndb_mgm_node_type type,
|
||||||
struct sockaddr *client_addr,
|
struct sockaddr *client_addr,
|
||||||
socklen_t *client_addr_len)
|
SOCKET_SIZE_TYPE *client_addr_len)
|
||||||
{
|
{
|
||||||
Guard g(&f_node_id_mutex);
|
Guard g(&f_node_id_mutex);
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -467,7 +467,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool getNextNodeId(NodeId * _nodeId, enum ndb_mgm_node_type type) const ;
|
bool getNextNodeId(NodeId * _nodeId, enum ndb_mgm_node_type type) const ;
|
||||||
bool alloc_node_id(NodeId * _nodeId, enum ndb_mgm_node_type type,
|
bool alloc_node_id(NodeId * _nodeId, enum ndb_mgm_node_type type,
|
||||||
struct sockaddr *client_addr, socklen_t *client_addr_len);
|
struct sockaddr *client_addr, SOCKET_SIZE_TYPE *client_addr_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -402,7 +402,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sockaddr addr;
|
struct sockaddr addr;
|
||||||
socklen_t addrlen= sizeof(addr);
|
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||||
int r = getpeername(m_socket, &addr, &addrlen);
|
int r = getpeername(m_socket, &addr, &addrlen);
|
||||||
if (r != 0 ) {
|
if (r != 0 ) {
|
||||||
m_output->println(cmd);
|
m_output->println(cmd);
|
||||||
|
|
Loading…
Reference in a new issue