From 026c55cafc2c8e33f4119cec3dbdd04ecdc897cd Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 4 Nov 2006 13:20:42 +0000 Subject: 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 --- src/socket.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/socket.cpp') 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); -- cgit v1.3.1-10-gc9f91