From 0a5069a11d41ea77c671e6f3b82dce59ba7b44ff Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Dec 2005 18:12:44 +0000 Subject: Code tidy git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2352 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index feea64699..fa3556737 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2637,7 +2637,14 @@ int InspIRCd(char** argv, int argc) bool expire_run = false; std::vector activefds; int incomingSockfd; + userrec* cu = NULL; + InspSocket* s = NULL; + char target[MAXBUF]; + unsigned int numsockets, numberactive; + /* Beta 7 moved all this stuff out of the main function + * into smaller sub-functions, much tidier -- Brain + */ OpenLog(argv, argc); CheckRoot(); SetupCommandTable(); @@ -2734,7 +2741,7 @@ int InspIRCd(char** argv, int argc) * listening ports or module sockets though, things could get * ugly. */ - unsigned int numberactive = activefds.size(); + numberactive = activefds.size(); for (unsigned int activefd = 0; activefd < numberactive; activefd++) { int socket_type = SE->GetType(activefds[activefd]); @@ -2742,7 +2749,7 @@ int InspIRCd(char** argv, int argc) { case X_ESTAB_CLIENT: - userrec* cu = fd_ref_table[activefds[activefd]]; + cu = fd_ref_table[activefds[activefd]]; if (cu) ProcessUser(cu); @@ -2754,10 +2761,10 @@ int InspIRCd(char** argv, int argc) * Modules are encouraged to inherit their sockets from * InspSocket so we can process them neatly like this. */ - unsigned int numsockets = module_sockets.size(); + numsockets = module_sockets.size(); for (std::vector::iterator a = module_sockets.begin(); a < module_sockets.end(); a++) { - InspSocket* s = (InspSocket*)*a; + s = (InspSocket*)*a; if ((s) && (s->GetFd() == activefds[activefd])) { if (!s->Poll()) @@ -2797,7 +2804,6 @@ int InspIRCd(char** argv, int argc) { if (activefds[activefd] == openSockfd[count]) { - char target[MAXBUF]; length = sizeof (client); incomingSockfd = accept (openSockfd[count], (struct sockaddr *) &client, &length); log(DEBUG,"Accepted socket %d",incomingSockfd); -- cgit v1.2.3