diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-12 18:12:44 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-12 18:12:44 +0000 |
commit | 0a5069a11d41ea77c671e6f3b82dce59ba7b44ff (patch) | |
tree | dfc07e4b47424c5555a118d0b84eeba9837bdfb1 /src | |
parent | 6997c6a3f0d5d858a2be779195953973a32e60bf (diff) |
Code tidy
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2352 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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<int> 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<InspSocket*>::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); |