return true;
}
}
-
+
ListenSocket* ll = new ListenSocket(tag, sa);
if (ll->GetFd() < 0)
{
continue;
}
+#ifndef _WIN32
// Are we creating a UNIX listener?
const std::string path = tag->getString("path");
if (!path.empty())
// Create the bindspec manually (aptosa doesn't work with AF_UNIX yet).
memset(&bindspec, 0, sizeof(bindspec));
bindspec.un.sun_family = AF_UNIX;
- stpncpy(bindspec.un.sun_path, path.c_str(), sizeof(bindspec.un.sun_path) - 1);
+ memcpy(&bindspec.un.sun_path, path.c_str(), sizeof(bindspec.un.sun_path));
if (!BindPort(tag, bindspec, old_ports))
failed_ports.push_back(std::make_pair(bindspec, errno));
else
bound++;
}
+#endif
}
std::vector<ListenSocket*>::iterator n = ports.begin();
}
else
{
- int range = ConvToInt(mask.substr(bits_chars + 1));
+ unsigned char range = ConvToNum<unsigned char>(mask.substr(bits_chars + 1));
irc::sockets::aptosa(mask.substr(0, bits_chars), 0, sa);
sa2cidr(*this, sa, range);
}
case AF_INET6:
base = (unsigned char*)&sa.in6.sin6_addr;
len = 16;
+ break;
case AF_UNIX:
return sa.un.sun_path;
}
memcpy(base, bits, len);
- return sa.addr() + "/" + ConvToStr(length);
+ return sa.addr() + "/" + ConvToStr((int)length);
}
bool irc::sockets::cidr_mask::operator==(const cidr_mask& other) const