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
27fcc9ec
Commit
27fcc9ec
authored
Sep 17, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-ndb-merge
parents
31ba0b2b
f5e6f233
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
ndb/include/util/SocketServer.hpp
ndb/include/util/SocketServer.hpp
+1
-1
ndb/src/common/util/SocketServer.cpp
ndb/src/common/util/SocketServer.cpp
+1
-1
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+27
-6
No files found.
ndb/include/util/SocketServer.hpp
View file @
27fcc9ec
...
@@ -76,7 +76,7 @@ public:
...
@@ -76,7 +76,7 @@ public:
* then close the socket
* then close the socket
* Returns true if succeding in binding
* Returns true if succeding in binding
*/
*/
bool
tryBind
(
unsigned
short
port
,
const
char
*
intface
=
0
)
const
;
static
bool
tryBind
(
unsigned
short
port
,
const
char
*
intface
=
0
)
;
/**
/**
* Setup socket
* Setup socket
...
...
ndb/src/common/util/SocketServer.cpp
View file @
27fcc9ec
...
@@ -47,7 +47,7 @@ SocketServer::~SocketServer() {
...
@@ -47,7 +47,7 @@ SocketServer::~SocketServer() {
}
}
bool
bool
SocketServer
::
tryBind
(
unsigned
short
port
,
const
char
*
intface
)
const
{
SocketServer
::
tryBind
(
unsigned
short
port
,
const
char
*
intface
)
{
struct
sockaddr_in
servaddr
;
struct
sockaddr_in
servaddr
;
memset
(
&
servaddr
,
0
,
sizeof
(
servaddr
));
memset
(
&
servaddr
,
0
,
sizeof
(
servaddr
));
servaddr
.
sin_family
=
AF_INET
;
servaddr
.
sin_family
=
AF_INET
;
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
27fcc9ec
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <ndb_global.h>
#include <pthread.h>
#include <
my_
pthread.h>
#include "MgmtSrvr.hpp"
#include "MgmtSrvr.hpp"
#include "MgmtErrorReporter.hpp"
#include "MgmtErrorReporter.hpp"
...
@@ -124,9 +124,10 @@ void *
...
@@ -124,9 +124,10 @@ void *
MgmtSrvr
::
logLevelThread_C
(
void
*
m
)
MgmtSrvr
::
logLevelThread_C
(
void
*
m
)
{
{
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
my_thread_init
();
mgm
->
logLevelThreadRun
();
mgm
->
logLevelThreadRun
();
my_thread_end
();
NdbThread_Exit
(
0
);
NdbThread_Exit
(
0
);
/* NOTREACHED */
/* NOTREACHED */
return
0
;
return
0
;
...
@@ -136,9 +137,10 @@ void *
...
@@ -136,9 +137,10 @@ void *
MgmtSrvr
::
signalRecvThread_C
(
void
*
m
)
MgmtSrvr
::
signalRecvThread_C
(
void
*
m
)
{
{
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
my_thread_init
();
mgm
->
signalRecvThreadRun
();
mgm
->
signalRecvThreadRun
();
my_thread_end
();
NdbThread_Exit
(
0
);
NdbThread_Exit
(
0
);
/* NOTREACHED */
/* NOTREACHED */
return
0
;
return
0
;
...
@@ -573,6 +575,9 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
...
@@ -573,6 +575,9 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
_props
=
NULL
;
_props
=
NULL
;
_ownNodeId
=
0
;
_ownNodeId
=
0
;
NodeId
tmp
=
nodeId
;
BaseString
error_string
;
#if 0
char my_hostname[256];
char my_hostname[256];
struct sockaddr_in tmp_addr;
struct sockaddr_in tmp_addr;
SOCKET_SIZE_TYPE addrlen= sizeof(tmp_addr);
SOCKET_SIZE_TYPE addrlen= sizeof(tmp_addr);
...
@@ -587,8 +592,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
...
@@ -587,8 +592,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
exit(-1);
exit(-1);
}
}
}
}
NodeId
tmp
=
nodeId
;
BaseString
error_string
;
if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM,
if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM,
(struct sockaddr *)&tmp_addr,
(struct sockaddr *)&tmp_addr,
&addrlen, error_string)){
&addrlen, error_string)){
...
@@ -596,6 +599,14 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
...
@@ -596,6 +599,14 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
<< error_string.c_str() << endl;
<< error_string.c_str() << endl;
exit(-1);
exit(-1);
}
}
#else
if
(
!
alloc_node_id
(
&
tmp
,
NDB_MGM_NODE_TYPE_MGM
,
0
,
0
,
error_string
)){
ndbout
<<
"Unable to obtain requested nodeid: "
<<
error_string
.
c_str
()
<<
endl
;
exit
(
-
1
);
}
#endif
_ownNodeId
=
tmp
;
_ownNodeId
=
tmp
;
...
@@ -2248,7 +2259,12 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
...
@@ -2248,7 +2259,12 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
continue
;
continue
;
}
}
// connecting through localhost
// connecting through localhost
// check if config_hostname match hostname
// check if config_hostname is local
#if 1
if
(
!
SocketServer
::
tryBind
(
0
,
config_hostname
))
{
continue
;
}
#else
char
my_hostname
[
256
];
char
my_hostname
[
256
];
if
(
gethostname
(
my_hostname
,
sizeof
(
my_hostname
))
!=
0
)
if
(
gethostname
(
my_hostname
,
sizeof
(
my_hostname
))
!=
0
)
continue
;
continue
;
...
@@ -2257,6 +2273,11 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
...
@@ -2257,6 +2273,11 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
// no match
// no match
continue
;
continue
;
}
}
#endif
}
}
else
{
// client_addr == 0
if
(
!
SocketServer
::
tryBind
(
0
,
config_hostname
))
{
continue
;
}
}
}
}
if
(
*
nodeId
!=
0
||
if
(
*
nodeId
!=
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