mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-26 16:56:19 +00:00
Changed: Minor changes
This commit is contained in:
parent
a445afef3c
commit
e2073f31d7
2 changed files with 28 additions and 18 deletions
|
@ -92,18 +92,18 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size)
|
|||
|
||||
BOOLEAN IN6_IS_ADDR_UNSPECIFIED(CONST IN6_ADDR *a)
|
||||
{
|
||||
//
|
||||
// We can't use the in6addr_any variable, since that would
|
||||
// require existing callers to link with a specific library.
|
||||
//
|
||||
return (BOOLEAN)((a->s6_words[0] == 0) &&
|
||||
(a->s6_words[1] == 0) &&
|
||||
(a->s6_words[2] == 0) &&
|
||||
(a->s6_words[3] == 0) &&
|
||||
(a->s6_words[4] == 0) &&
|
||||
(a->s6_words[5] == 0) &&
|
||||
(a->s6_words[6] == 0) &&
|
||||
(a->s6_words[7] == 0));
|
||||
//
|
||||
// We can't use the in6addr_any variable, since that would
|
||||
// require existing callers to link with a specific library.
|
||||
//
|
||||
return (BOOLEAN)((a->s6_words[0] == 0) &&
|
||||
(a->s6_words[1] == 0) &&
|
||||
(a->s6_words[2] == 0) &&
|
||||
(a->s6_words[3] == 0) &&
|
||||
(a->s6_words[4] == 0) &&
|
||||
(a->s6_words[5] == 0) &&
|
||||
(a->s6_words[6] == 0) &&
|
||||
(a->s6_words[7] == 0));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -730,7 +730,8 @@ std::vector<CInetAddress> CInetAddress::localAddresses()
|
|||
while (p != NULL)
|
||||
{
|
||||
// check address family
|
||||
if (p->ai_family == AF_INET){ // ipv4
|
||||
if (p->ai_family == AF_INET)
|
||||
{
|
||||
// loopback ipv4
|
||||
if(!psin_addrIPv4){ // add loopback address only once
|
||||
struct in_addr *psin_addrIPv4 = new in_addr;
|
||||
|
@ -743,7 +744,8 @@ std::vector<CInetAddress> CInetAddress::localAddresses()
|
|||
vect.push_back( CInetAddress( &ipv4->sin_addr, localhost ) );
|
||||
|
||||
}
|
||||
else if (p->ai_family == AF_INET6){ // ipv6
|
||||
else if (p->ai_family == AF_INET6)
|
||||
{
|
||||
// loopback ipv6
|
||||
if(!psin_addrIPv6){ // add loopback address only once
|
||||
struct in6_addr aLoopback6 = IN6ADDR_LOOPBACK_INIT;
|
||||
|
|
|
@ -1294,8 +1294,11 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
if (connectionId >= _IdCnx[sid.get()].Connections.size() || !_IdCnx[sid.get()].Connections[connectionId].valid() || !_IdCnx[sid.get()].Connections[connectionId].CbNetBase->connected())
|
||||
{
|
||||
|
||||
if(nid != 0xFF) // not a default network. There's a problem with the selected connectionID, so try to find a valid one
|
||||
if (nid != 0xFF)
|
||||
{
|
||||
// not a default network. There's a problem with the selected connectionID, so try to find a valid one
|
||||
nlwarning ("HNETL5: Can't find selected connection id %hu to send message to %s because connection is not valid or connected, find a valid connection id", (uint16)connectionId, _IdCnx[sid.get()].ServiceName.c_str ());
|
||||
}
|
||||
|
||||
for (connectionId = 0; connectionId < _IdCnx[sid.get()].Connections.size(); connectionId++)
|
||||
{
|
||||
|
@ -1303,13 +1306,18 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
{
|
||||
// we found one at last, use this one
|
||||
//nldebug ("HNETL5: Ok, we found a valid connectionid, use %hu", (uint16)connectionId);
|
||||
if(nid < _IdCnx[sid.get()].NetworkConnectionAssociations.size()){
|
||||
if (nid < _IdCnx[sid.get()].NetworkConnectionAssociations.size())
|
||||
{
|
||||
_IdCnx[sid.get()].NetworkConnectionAssociations[nid] = connectionId; // we set the preferred networkConnectionAssociation
|
||||
} else {
|
||||
if(nid == 0xFF){
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nid == 0xFF)
|
||||
{
|
||||
_IdCnx[sid.get()].DefaultNetwork = connectionId;
|
||||
}
|
||||
}
|
||||
|
||||
nlwarning ("HNETL5: selected connection id %hu from network %hu to send message to %s", (uint16)connectionId, (uint16)nid, _IdCnx[sid.get()].ServiceName.c_str ());
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue