X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsocket.cpp;h=b33664f84ee84c70734f2dbc7a4b20993da4292f;hb=a032cd90ad5582914759e226085efee5aae1a1ef;hp=1d110323567a589ca39d3a55c89a2c1884363540;hpb=b7716ed57704b2b2bcc665a590aecc8f02de631d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/socket.cpp b/src/socket.cpp index 1d1103235..b33664f84 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -39,7 +39,7 @@ bool InspIRCd::BindPort(ConfigTag* tag, const irc::sockets::sockaddrs& sa, std:: return true; } } - + ListenSocket* ll = new ListenSocket(tag, sa); if (ll->GetFd() < 0) { @@ -93,6 +93,7 @@ int InspIRCd::BindPorts(FailedPortList& failed_ports) continue; } +#ifndef _WIN32 // Are we creating a UNIX listener? const std::string path = tag->getString("path"); if (!path.empty()) @@ -109,13 +110,14 @@ int InspIRCd::BindPorts(FailedPortList& failed_ports) // 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::iterator n = ports.begin(); @@ -352,7 +354,7 @@ irc::sockets::cidr_mask::cidr_mask(const std::string& mask) } else { - int range = ConvToInt(mask.substr(bits_chars + 1)); + unsigned char range = ConvToNum(mask.substr(bits_chars + 1)); irc::sockets::aptosa(mask.substr(0, bits_chars), 0, sa); sa2cidr(*this, sa, range); } @@ -375,6 +377,7 @@ std::string irc::sockets::cidr_mask::str() const case AF_INET6: base = (unsigned char*)&sa.in6.sin6_addr; len = 16; + break; case AF_UNIX: return sa.un.sun_path; @@ -386,7 +389,7 @@ std::string irc::sockets::cidr_mask::str() const } 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