2120 Commits

Author SHA1 Message Date
Peter Powell
f237007bc1 Fix the command table not being case insensitive.
This is not an issue normally but in some circumstances (e.g. when
disabling commands) it can result in command lookups failing even
when they exist.
2017-10-16 20:46:16 +01:00
Peter Powell
45fc75457b Use DLLManager::RetrieveLastError() on all platforms.
This prevents a bug where we send malformed messages to the client
when dlerror() returns an error message containing more than one
line. This has been observed on macOS but probably will happen on
other UNIX systems too.

This also fixes a potential problem where dlerror() returns NULL
and converting it to std::string causes a crash. I can't see any
way that this might happen but it is better to be safe than sorry.
2017-08-26 19:01:27 +01:00
Peter Powell
756c89cfcc Fix some compiler warnings.
warning: macro name is a reserved identifier [-Wreserved-id-macro]
warning: extra ';' after member function definition [-Wextra-semi]
2017-03-20 10:24:01 +00:00
Attila Molnar
925afed1b9 Don't exit on rehash if the pid file cannot be written 2016-06-17 12:04:12 +02:00
Adam
f80798f2c1 Don't show snotices for kills from ulined clients 2016-02-25 08:54:28 -05:00
Attila Molnar
09c716ce11 Limit DNS cache size 2016-02-13 19:23:07 +01:00
Attila Molnar
4dd7fb60a8 Merge pull request #1004 from SaberUK/insp20+fix-various-warnings
[2.0] Fix various warnings with the new Doxygen and LLVM releases.
2015-03-23 00:42:59 +01:00
Adam
7f051bcc51 Rebuild clone counts on rehash 2015-03-21 12:53:21 -04:00
Peter Powell
c38d29fd76 Fix various Doxygen warnings. 2015-02-27 00:34:21 +00:00
Peter Powell
f5519a585f Fix modules not being versioned on Windows. 2015-01-17 15:31:35 +00:00
Peter Powell
6935ce2956 Avoid calling methods on NULL pointers wherever possible.
The trick we use to allow this is undefined behaviour and is not
liked by LLVM. We should stop using it but it has the potential to
break to many things for a minor release.
2014-10-13 06:18:14 +01:00
Peter Powell
e59943c1a5 Fix hash_map.h on non-GNU C++ standard library implementations. 2014-10-05 03:49:42 +01:00
Adam
df67ab549b Do not use the result of the dns cache when the query type of the result is different from the type of the query. #66 2014-09-08 18:19:00 -04:00
Adam
86e313cb46 Do not export callers
Their functions are all inlined and Windows gives unresolved symbol errors
2014-05-08 19:56:31 -04:00
Attila Molnar
b65fb065b5 Fix undefined symbol error on module load if compiled with Clang 3.4
Fixes issue #803 reported by @SaberUK
2014-04-19 17:10:01 +02:00
Attila Molnar
89510c143f Bump API version because of 3f4d54eb031f1cd6b016dfe1f768ed86303e3856 2014-01-21 14:13:02 +01:00
attilamolnar
d743bdf338 Fix ConvToStr(char) 2013-09-14 15:23:45 +02:00
ChrisTX
718a87e7e4 Fix a shadow warning created by ConfigTag::create 2013-09-13 18:00:19 +02:00
ChrisTX
3f4d54eb03 Fix a crash when running as systemd service
- Fix a NULL dereference if a signal is raised in the constructor of the
class InspIRCd
- Resolve the parent's process exit code being SIGTERM=15 and typically not
EXIT_SUCCESS thus

A combination of the two caused crashes when running as systemd unit.
2013-09-08 12:10:01 +02:00
attilamolnar
d54eec6dd8 Don't CoreExport reference, fixes m_dnsbl on Windows
The explicit instantiations of reference are now useless; remove
2013-08-30 12:10:01 +02:00
Adam
6e0b904d34 Use the correct socket related error messages on Windows 2013-07-14 20:23:53 +02:00
attilamolnar
67822c67e9 Initialize local_count 2013-05-18 16:03:17 +02:00
attilamolnar
bb962f92ac Workaround for std::list::size() having linear complexity on some implementations 2013-05-16 20:51:12 +02:00
attilamolnar
0a8b0d317e Remove unused variables, avoid copies where possible, check empty() instead of size() == 0
Most of these were detected by cppcheck
2013-05-16 20:33:46 +02:00
attilamolnar
2bb64c5dcf Move SocketEngine::IgnoreError() code into socketengine.h and add test for EWOULDBLOCK 2013-04-24 19:54:58 +02:00
Adam
47332d6e9b Fix m_ssl_gnutls and perhaps some other things on Windows by recognizing WSAEWOULDBLOCK 2013-04-16 18:19:42 -05:00
attilamolnar
0fa365373e Don't attempt to unload or reload modules that are waiting to be unloaded 2013-04-05 18:23:44 +02:00
attilamolnar
fd6a8e9392 Add support for mandatory tags in included config files
If the mandatory tag is not found in the included config, the rehash is aborted. This is especially useful for remote includes, as it allows users to have a dummy tag at the end of the included config to indicate that the config has been wholly read.
This method does not depend on exit codes so even situations where wget returns an empty or a wrong page that we would otherwise accept can be detected and an error can be generated before we assume that the contents have disappeared (and unload all modules, if the included file is supposed to contain module tags, for example).

Usage: <include ... mandatorytag="namehere"> - if the included config doesn't contain a <namehere> tag then the rehash is aborted

Fixes #30 reported by @Justasic
2013-03-20 21:43:46 +01:00
attilamolnar
ade9cc2134 Remove dead code from DNS 2013-03-11 20:52:21 +01:00
attilamolnar
fe9e594755 Fix m_dnsbl not checking cgiirc users when the cgiirc address is elined 2013-03-11 20:48:58 +01:00
Peter Powell
2e04480f21 Use the preprocessor to detect whether hash_map is available. 2013-01-28 21:38:03 +00:00
Peter Powell
1883b0cebe Fix warning: "const type qualifier on return type has no effect". 2013-01-16 11:13:23 +00:00
Peter Powell
020eeeabd8 Include <list> in base.h to prevent build errors on OpenBSD. 2012-12-25 18:39:03 +01:00
attilamolnar
d00914ed6f Add a flag to Command that controls whether an empty last parameter is allowed or not 2012-12-15 21:17:06 +01:00
attilamolnar
71d53e4883 Remove ServerLimits::Finalise(), it's completely wrong
Truncate <limits:identmax>+1 long idents in User::ChangeIdent()
2012-12-09 18:12:09 +01:00
attilamolnar
73074b0a78 Change a few signed counter variables to unsigned so they roll over later 2012-12-05 21:49:39 +01:00
attilamolnar
eea9343393 Throw an exception when attempting to register an extension with a name that already exists
Previously this silently failed
2012-12-02 19:43:20 +01:00
attilamolnar
74b05d5500 Make LocalUserList an std::list 2012-11-29 23:41:22 +01:00
attilamolnar
a589577b68 Add a typedef for LocalUserList 2012-11-29 23:41:22 +01:00
attilamolnar
504caa8ca9 Fix typo in doc and remove some whitespace 2012-10-29 18:33:07 +01:00
attilamolnar
954786c678 Move ServerConfig::ProcessColors() into class InspIRCd, as a helper function
Change signature to accept a file_cache reference so modules can use it easily
2012-10-29 18:27:17 +01:00
Peter Powell
3479532178 Fix for #268.
- Move color stripping code to helperfuncs.
- Strip color codes before matching filters.
2012-10-19 17:50:08 +02:00
ChrisTX
90aa5811d1 Resolve two warnings clang complains about
No newline at end of file in consolecolors.h
String plus int in snomasks
2012-10-14 23:58:20 +02:00
ChrisTX
ebdaf368e1 Replace printf(_c) with iostream 2012-10-14 02:13:49 +02:00
ChrisTX
5b9682275e Windows: In-depth cleanup (see details)
-Fix x64 builds for Windows. Now all configurations compile.
-Remove the non-working rebase stuff.
-Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now.
-Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2
-Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need.
-Enable optimizations for release builds.
-De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure
-Add the VC++ specific bad files in .gitignore
-Disable PID writing on Windows. This is only making sense for *nix builds.
-Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working)
-Removed certain unused functions and variables
-Remove stdint defines from the windows wrapper
-Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds.
-Re-evaluated the warnings list, commented it.
-Moved inspircd_config/_version to include/ to match *nix
-Removed the creation of inspircd_se_config, as it isn't used at all.
-Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out)
-Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly.
-Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down)
-Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded.
-Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways)
-Removed the unused ClearConsole()
-Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate.
-Made inet_aton an inline function for increased performance
-C4800, performance warning about bool forcing, resolved at all occurrences.
-C4701, uninitialized variable 'cached', resolved at all occurrences.
-dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance.
-Removed the wrong CRT debug flags. This drains a lot of performance.
-Removed the clock_gettime/gettimeofday wrappers
-Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function.
-Added a block of C4355 for < VS2012
-Update project files for c870714
2012-10-12 22:31:38 +02:00
attilamolnar
c8707149b2 Move simple user and channel mode handlers into a single file 2012-10-08 16:58:42 +02:00
attilamolnar
13b7084eae Change User::SetClientIP() to be virtual 2012-10-03 20:36:20 +02:00
attilamolnar
6abc0b8ca7 Make ConfigReader::GetSID() return a const reference to a string instead of a string 2012-09-30 03:04:08 +02:00
attilamolnar
2115bd71dc Call OnUserSetIP() whenever the IP of a local user changes, set ident,host,dhost in LocalUser constructor 2012-09-13 18:51:28 +02:00
attilamolnar
91abba488a New OnUserSetIP() hook 2012-09-13 18:51:28 +02:00