mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
This commit is contained in:
commit
ec6d198ea0
5 changed files with 13 additions and 12 deletions
|
@ -74,7 +74,7 @@ public:
|
|||
/**
|
||||
* Constructor / Destructor
|
||||
*/
|
||||
SocketServer(int maxSessions = 32);
|
||||
SocketServer(unsigned maxSessions = ~(unsigned)0);
|
||||
~SocketServer();
|
||||
|
||||
/**
|
||||
|
|
|
@ -105,10 +105,10 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) {
|
|||
}
|
||||
|
||||
{
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||
int r= getpeername(sockfd, &addr, &addrlen);
|
||||
m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
|
||||
int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen);
|
||||
m_connect_address= (&addr)->sin_addr;
|
||||
}
|
||||
|
||||
bool res = connect_server_impl(sockfd);
|
||||
|
@ -198,10 +198,10 @@ Transporter::connect_client(NDB_SOCKET_TYPE sockfd) {
|
|||
}
|
||||
|
||||
{
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||
int r= getpeername(sockfd, &addr, &addrlen);
|
||||
m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
|
||||
int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen);
|
||||
m_connect_address= (&addr)->sin_addr;
|
||||
}
|
||||
|
||||
bool res = connect_client_impl(sockfd);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define DEBUG(x) ndbout << x << endl;
|
||||
|
||||
SocketServer::SocketServer(int maxSessions) :
|
||||
SocketServer::SocketServer(unsigned maxSessions) :
|
||||
m_sessions(10),
|
||||
m_services(5)
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ SocketServer::setup(SocketServer::Service * service,
|
|||
}
|
||||
|
||||
DBUG_PRINT("info",("bound to %u",ntohs(servaddr.sin_port)));
|
||||
if (listen(sock, m_maxSessions) == -1){
|
||||
if (listen(sock, m_maxSessions > 32 ? 32 : m_maxSessions) == -1){
|
||||
DBUG_PRINT("error",("listen() - %d - %s",
|
||||
errno, strerror(errno)));
|
||||
NDB_CLOSE_SOCKET(sock);
|
||||
|
|
|
@ -451,9 +451,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
|
|||
return;
|
||||
}
|
||||
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||
int r = getpeername(m_socket, &addr, &addrlen);
|
||||
int r = getpeername(m_socket, (struct sockaddr*)&addr, &addrlen);
|
||||
if (r != 0 ) {
|
||||
m_output->println(cmd);
|
||||
m_output->println("result: getpeername(%d) failed, err= %d", m_socket, r);
|
||||
|
@ -465,7 +465,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
|
|||
if(tmp == 0 || !m_allocated_resources->is_reserved(tmp)){
|
||||
BaseString error_string;
|
||||
if (!m_mgmsrv.alloc_node_id(&tmp, (enum ndb_mgm_node_type)nodetype,
|
||||
&addr, &addrlen, error_string)){
|
||||
(struct sockaddr*)&addr, &addrlen, error_string)){
|
||||
const char *alias;
|
||||
const char *str;
|
||||
alias= ndb_mgm_get_node_type_alias_string((enum ndb_mgm_node_type)
|
||||
|
|
|
@ -659,6 +659,7 @@ fi
|
|||
%attr(755, root, root) %{_bindir}/ndb_desc
|
||||
%attr(755, root, root) %{_bindir}/ndb_show_tables
|
||||
%attr(755, root, root) %{_bindir}/ndb_test_platform
|
||||
%attr(755, root, root) %{_bindir}/ndb_config
|
||||
|
||||
%files ndb-extra
|
||||
%defattr(-,root,root,0755)
|
||||
|
|
Loading…
Reference in a new issue