Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5e6a1a89
Commit
5e6a1a89
authored
Jun 30, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added flexibility for connecting and retrieving config from mgmtsrvr
parent
1d343db6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
+27
-14
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+27
-14
No files found.
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
5e6a1a89
...
@@ -2324,20 +2324,33 @@ MgmtSrvr::getFreeNodeId(NodeId * nodeId, enum ndb_mgm_node_type type,
...
@@ -2324,20 +2324,33 @@ MgmtSrvr::getFreeNodeId(NodeId * nodeId, enum ndb_mgm_node_type type,
const
char
*
config_hostname
=
0
;
const
char
*
config_hostname
=
0
;
if
(
iter
.
get
(
CFG_NODE_HOST
,
&
config_hostname
))
abort
();
if
(
iter
.
get
(
CFG_NODE_HOST
,
&
config_hostname
))
abort
();
// getsockname(int s, struct sockaddr *name, socklen_t *namelen);
if
(
config_hostname
&&
config_hostname
[
0
]
!=
0
&&
client_addr
)
{
if
(
config_hostname
&&
config_hostname
[
0
]
!=
0
&&
client_addr
)
{
// check hostname compatability
// check hostname compatability
struct
in_addr
config_addr
;
struct
in_addr
config_addr
;
const
void
*
tmp
=
&
(((
sockaddr_in
*
)
client_addr
)
->
sin_addr
);
if
(
Ndb_getInAddr
(
&
config_addr
,
config_hostname
)
!=
0
if
(
Ndb_getInAddr
(
&
config_addr
,
config_hostname
)
!=
0
||
memcmp
(
&
config_addr
,
&
(((
sockaddr_in
*
)
client_addr
)
->
sin_addr
),
||
memcmp
(
&
config_addr
,
tmp
,
sizeof
(
config_addr
))
!=
0
)
{
sizeof
(
config_addr
))
!=
0
)
{
struct
in_addr
tmp_addr
;
if
(
Ndb_getInAddr
(
&
tmp_addr
,
"localhost"
)
!=
0
||
memcmp
(
&
tmp_addr
,
tmp
,
sizeof
(
config_addr
))
!=
0
)
{
// not localhost
#if 0
#if 0
ndbout << "MgmtSrvr::getFreeNodeId compare failed for \"" << config_hostname
ndbout << "MgmtSrvr::getFreeNodeId compare failed for \"" << config_hostname
<< "\" id=" << tmp << endl;
<< "\" id=" << tmp << endl;
#endif
#endif
continue
;
continue
;
}
}
// connecting through localhost
// check if config_hostname match hostname
char
my_hostname
[
256
];
if
(
gethostname
(
my_hostname
,
sizeof
(
my_hostname
))
!=
0
)
continue
;
if
(
Ndb_getInAddr
(
&
tmp_addr
,
my_hostname
)
!=
0
||
memcmp
(
&
tmp_addr
,
&
config_addr
,
sizeof
(
config_addr
))
!=
0
)
{
// no match
continue
;
}
}
}
}
*
nodeId
=
tmp
;
*
nodeId
=
tmp
;
#if 0
#if 0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment