mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
ndb - bug#22195
also bind client to local host name if specified
This commit is contained in:
parent
88d70378fb
commit
f21394beef
1 changed files with 14 additions and 4 deletions
|
@ -60,9 +60,6 @@ Transporter::Transporter(TransporterRegistry &t_reg,
|
|||
}
|
||||
strncpy(localHostName, lHostName, sizeof(localHostName));
|
||||
|
||||
if (strlen(lHostName) > 0)
|
||||
Ndb_getInAddr(&localHostAddress, lHostName);
|
||||
|
||||
DBUG_PRINT("info",("rId=%d lId=%d isServer=%d rHost=%s lHost=%s s_port=%d",
|
||||
remoteNodeId, localNodeId, isServer,
|
||||
remoteHostName, localHostName,
|
||||
|
@ -128,9 +125,22 @@ Transporter::connect_client() {
|
|||
return true;
|
||||
|
||||
if(isMgmConnection)
|
||||
{
|
||||
sockfd= m_transporter_registry.connect_ndb_mgmd(m_socket_client);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_socket_client->init())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (strlen(localHostName) > 0)
|
||||
{
|
||||
if (m_socket_client->bind(localHostName, 0) != 0)
|
||||
return false;
|
||||
}
|
||||
sockfd= m_socket_client->connect();
|
||||
}
|
||||
|
||||
return connect_client(sockfd);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue