4311 Commits

Author SHA1 Message Date
brain
dfcfcb6f0e Added a comment /* GNUs smell */ to an #ifdef linux makes us put in
(what sort of craqsmoker puts posix standard functions that belong in unistd.h into getopt.h but only on linux? muppets).
#ifdef _GNU_SOURCE
#include <getopt.h>
#endif .....


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6094 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 11:18:02 +00:00
brain
dcad7974ce Change argument parsing to use getopt_long_only().
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6093 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 11:13:31 +00:00
peavey
7f6344e3ad Fix a bug in whowas that could desync list.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6091 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 04:01:45 +00:00
peavey
397a77259a Add whowas usage to stats z.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6090 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 01:43:19 +00:00
brain
c78bff4fb1 Neither should this
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6089 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 00:53:00 +00:00
brain
69b3f63bb1 Relatively small typo fix
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6088 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 00:51:29 +00:00
brain
31f75f75be Add call for OnGarbageCollect to the hourly cleanup
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6087 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 00:43:02 +00:00
brain
b31a8ee0ad Add OnGarbageCollect method
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6086 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 00:42:22 +00:00
brain
73ddc65a28 Do garbage collection of hash map automatically every hour
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6085 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 00:37:15 +00:00
brain
f2dfc4be59 Fix loop when quitting multiple users (this is probably whats eating cpu)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6084 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-24 00:34:13 +00:00
brain
f85fdf431e Better checks for NULL log handles
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6083 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 23:58:26 +00:00
brain
e473ba1a25 We can't log in SocketEngine::DelFd(), because the fd we're removing might just be that of the logger!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6082 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 23:52:53 +00:00
brain
72da54c1c2 Crash on /rehash fixed (old code in here passed NULL, 0 as argc, argv, this is BAD BAD BAD.)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6081 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 23:18:34 +00:00
brain
74c8913f72 Hash rehashing change
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6080 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 23:06:37 +00:00
brain
6cc7cd76fb Close logfile on rehash and reopen (it was only doing this on sighup for some reason)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6079 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 17:08:02 +00:00
brain
6c9a69cbad Dont sleep if there is a diedelay of 0
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6078 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 16:43:46 +00:00
brain
f9ef034ef5 Fix exit in wrong place, and add new exitcodes.h
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6077 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 16:41:22 +00:00
brain
de3978c580 Fix bug in m_dnsbl, a condition is always matched because someone was using unsigned int to check a return val that can be -1 *slap w00t*
Change around the way exit codes are formed so that we can return a sensible exit code that reflects why inspircd exited


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6076 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 16:40:09 +00:00
brain
e04f190f63 Program termination (including SIGTERM) now calls InspIRCd::Cleanup() which does most of the duties performed by InspIRCd::Restart().
This means that on controlled shutdown we give the modules a chance to unload, etc, and close our sockets and free ram in a proper way.


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6075 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 16:06:16 +00:00
brain
c1316150a7 Fix issue where the last module to be loaded wasnt unloaded by restart
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6074 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 15:14:54 +00:00
brain
f5f71bdfef Cut down on debug on restart
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6073 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 15:04:14 +00:00
brain
3a07789b15 Use GetModuleCount() rather than the member var
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6072 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 15:01:26 +00:00
brain
d490ee11a8 Fix glitch when restarting on 2nd pass of module unload
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6071 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 14:57:15 +00:00
brain
1bfe43ebfd Add more comments.
Catch CoreException in cmd_restart, and if we catch one, just exit(0). Theres very little else we could do.


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6070 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 14:54:47 +00:00
brain
4c8c7e6c70 Close client sockets too (do these last)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6069 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 14:22:14 +00:00
brain
529c6acc01 Unload as many modules as we can on restart, and close listeners
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6068 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 14:19:33 +00:00
brain
371daf9928 Refactored /RESTART (and added InspIRCd::Restart(reason))
Fixed bug in m_ziplinks, assigning instead of testing a var (gcc 4.1.1 picked up on this, 3.4 didnt)


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6067 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-23 14:06:57 +00:00
peavey
089cf1f5fd change userrec int timeout to time_t since it's a timestamp made of TIME + users connection class timeout.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6066 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 22:02:50 +00:00
brain
18d1a07987 Uninitialized values: fun for ALL the family this xmas time.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6065 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 21:27:42 +00:00
brain
b3a11cb400 Line 1582 configreader.cpp
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6063 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 20:32:59 +00:00
brain
56481aed7e Remove useless debug
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6062 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 20:13:14 +00:00
brain
49eabd1197 Refactor connect allow/deny lines
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6061 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 20:12:15 +00:00
brain
9bfb3f0068 Reduce logging caused by mode changes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6060 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 17:45:05 +00:00
brain
c65590448c Fix for alias var names within aliases
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6059 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 17:35:33 +00:00
special
8f8459533b Fixed to compile properly with -O; keep in mind that this is not supported, use at your own risk.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6058 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-22 00:57:18 +00:00
brain
86f8778498 Fix for bug #180, logging is not threadsafe, mutex it (ew, luckily we dont log much)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6056 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-21 20:34:16 +00:00
brain
ea1b0d4b16 And back onto the SVN track...
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6055 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-21 19:30:01 +00:00
brain
38667cb9fd Beta 6, patchlevel 1 (lets try this again.)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6053 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-21 19:16:44 +00:00
peavey
64c8881fe5 Proper fix for CS server crash, forgot to delete chanrec* from users chanlist on PurgeEmptyChannels()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6052 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-21 01:48:50 +00:00
peavey
930c2feca5 Crude hotfix to what's been crashing chatspike
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6051 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-21 01:04:53 +00:00
special
b3e9ee509d This should fix the issue with unsetting +J
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6050 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-21 00:40:15 +00:00
brain
3705f90b1a When we handle a READ event on a user, return immediately.
This is  because the read event may remove the user, in which case the !empty and quituser check below will address invalid data!


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6049 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-19 20:27:23 +00:00
w00t
8ebb15caa9 Fix server prefix on JOIN.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6048 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-19 18:02:13 +00:00
w00t
54b9174b73 Avoid no such nick on non oper attempting to view modes of a user.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6047 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 23:36:25 +00:00
brain
59427ca7f1 std::string something = "";
is the most redundant and wasteful thing in the world, apart from unrealircd. BE GONE WITH IT!


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6046 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 18:42:17 +00:00
brain
dc92b9996c Whack a warning (unused var)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6045 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 18:40:36 +00:00
brain
011c4b9b07 Then, realize you got your subtraction back to front.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6044 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 18:39:41 +00:00
brain
e80337c204 Really clever VOODOO.
RegisteredUserCount() used to take longer to execute than UnregisteredUserCount(), as all unregged users are local, so you only need to count in the local 
vector not the global map.
Therefore, make RegisteredUserCount() just return this:   this->UnregisteredUserCount() - clientlist.size()


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6043 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 18:39:17 +00:00
brain
1c52b90e82 Refactor dns.cpp to use an array of request types rather than map, for O(1) lookup time
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6042 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 18:35:25 +00:00
w00t
52d979a282 Fix bug in m_dnsbl: Only the first <dnsbl> tag would be processed.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6041 e03df62e-2008-0410-955e-edbf42e46eb7
2006-12-18 12:17:06 +00:00