X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Flistensocket.cpp;h=961156ae6f74e4b846397d6ab3ef9d4ea33446d2;hb=d6bec26bc7c329c0d3d6d84203ecd12a26dac91b;hp=3ecfbb432d54dcd2db18924e058b72fceb18433e;hpb=74f401f1997b89783217cd636f396e35f5c2a9d0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 3ecfbb432..961156ae6 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -24,15 +24,15 @@ sockaddr* ListenSocketBase::sock_us = NULL; sockaddr* ListenSocketBase::client = NULL; sockaddr* ListenSocketBase::raddr = NULL; -ListenSocketBase::ListenSocketBase(InspIRCd* Instance, int port, char* addr) : ServerInstance(Instance), desc("plaintext"), bind_addr(addr), bind_port(port) +ListenSocketBase::ListenSocketBase(InspIRCd* Instance, int port, const std::string &addr) : ServerInstance(Instance), desc("plaintext"), bind_addr(addr), bind_port(port) { - this->SetFd(irc::sockets::OpenTCPSocket(addr)); + this->SetFd(irc::sockets::OpenTCPSocket(addr.c_str())); if (this->GetFd() > -1) { - if (!Instance->BindSocket(this->fd,port,addr)) + if (!Instance->BindSocket(this->fd,port,addr.c_str())) this->fd = -1; #ifdef IPV6 - if ((!*addr) || (strchr(addr,':'))) + if ((!*addr.c_str()) || (strchr(addr.c_str(),':'))) this->family = AF_INET6; else #endif