]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
* Fix inspsocket to not include uio.h on windows.
[user/henk/code/inspircd.git] / src / socket.cpp
index 00be4250bac0ac6030ddde5b271eab16045cad16..74427d42a5569677fa81a66d7dbe458b05040b94 100644 (file)
@@ -27,10 +27,7 @@ bool InspIRCd::BindSocket(int sockfd, int port, const char* addr, bool dolisten)
        sockaddrs servaddr;
        int ret;
 
-       if (*addr == '*' || *addr == '\0')
-               addr = NULL;
-
-       if (port == -1 && !addr)
+       if ((*addr == '*' || *addr == '\0') && port == -1)
        {
                /* Port -1: Means UDP IPV4 port binding - Special case
                 * used by DNS engine.
@@ -147,16 +144,16 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
                                }
                                if (!skip)
                                {
-                                       ClientListenSocket *ll = new ClientListenSocket(portno, Addr);
+                                       ClientListenSocket *ll = new ClientListenSocket(portno, Addr, "clients", *Desc ? Desc : "plaintext");
                                        if (ll->GetFd() > -1)
                                        {
                                                bound++;
-                                               ll->SetDescription(*Desc ? Desc : "plaintext");
                                                ports.push_back(ll);
                                        }
                                        else
                                        {
                                                failed_ports.push_back(std::make_pair(bind_readable, strerror(errno)));
+                                               delete ll;
                                        }
                                }
                        }