diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-04 13:20:42 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-04 13:20:42 +0000 |
commit | 026c55cafc2c8e33f4119cec3dbdd04ecdc897cd (patch) | |
tree | bc9aa0185fcb74adcf59153b830612ab170f5555 /src/socket.cpp | |
parent | e53d30bc6d4c3b002f08569b68affa540104d5cf (diff) |
As requested by satmd, inspircd will now run with no client ports configured
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5643 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 225b27733..1e0762321 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -389,19 +389,21 @@ bool InspIRCd::HasPort(int port, char* addr) } /* XXX: Probably belongs in class InspIRCd */ -int InspIRCd::BindPorts(bool bail) +int InspIRCd::BindPorts(bool bail, int &ports_found) { char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF]; insp_sockaddr client, server; int clientportcount = 0; int BoundPortCount = 0; + ports_found = 0; + if (!bail) { int InitialPortCount = stats->BoundPortCount; this->Log(DEBUG,"Initial port count: %d",InitialPortCount); - for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++) + for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++, ports_found++) { Config->ConfValue(Config->config_data, "bind", "port", count, configToken, MAXBUF); Config->ConfValue(Config->config_data, "bind", "address", count, Addr, MAXBUF); @@ -460,7 +462,7 @@ int InspIRCd::BindPorts(bool bail) return InitialPortCount; } - for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++) + for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++, ports_found++) { Config->ConfValue(Config->config_data, "bind", "port", count, configToken, MAXBUF); Config->ConfValue(Config->config_data, "bind", "address", count, Addr, MAXBUF); |