Bram Matthys
12dbbca15e
Rip out support for changing offsets via TSCTL and tune file. Use NTP!!
...
Adjustments via TSCTL are never accurate enough.
2019-06-08 09:26:55 +02:00
Bram Matthys
d796247ddf
Re-indent
2019-06-07 15:08:23 +02:00
Bram Matthys
a2ee5d67f3
Update a few hooks to include mtags, more will follow later.
...
This fixes inconsistent mtags accross server links with delayjoin.
2019-06-07 15:05:10 +02:00
Bram Matthys
1f2bb0d89b
Delayjoin: if kicking invisible user we used to clear the invisibility
...
status of the victim (JOIN+KICK). That seems unnecessary to me, since
there is already code in place to handle this -- hopefully it works too.
2019-06-07 14:41:01 +02:00
Bram Matthys
61b4a6ea29
Add mtags in non-chan PRIVMSG. Remove sendto_message_one since you can
...
just use sendto_prefix_one. Actually it was only used at 1 place (m_message).
2019-06-07 14:25:28 +02:00
Bram Matthys
0e68265e12
Remove sock.h old compatibility code. Shouldn't be needed anymore.
...
(This provided FD_ZERO and such if the OS/libc did not provide it)
2019-06-07 12:42:28 +02:00
Bram Matthys
de89de9558
Fix MODE not sending message tags across servers
2019-06-07 12:34:22 +02:00
GottemHams
d292d2ee9c
Forgot to change a couple X:Line things to X-Line
2019-06-05 19:27:00 +02:00
GottemHams
8846506292
Might be a good idea to also skip local Q:Lines (ban nick {} blocks) :D
2019-06-05 19:19:03 +02:00
Bram Matthys
e423f69082
[tkldb] Add some extra check for trailing DB data.
...
If everything goes correctly then after reading all TKL entries we
should be at the end of file. If there is still data after that,
something went wrong... quite wrong.. :D
2019-06-05 09:39:59 +02:00
Bram Matthys
673779eab9
Write string lengths as 16-bit rather than 64-bit: saves about 34% space
...
of the database file, with possible some small speed improvement as well.
2019-06-05 09:35:43 +02:00
Bram Matthys
ec5811dc3b
[tkldb] Save every 5 minutes now that writing is fast enough :)
...
And mention the benchmark figures in the .c file.
2019-06-05 09:01:04 +02:00
Bram Matthys
eaa1b213b9
[tkldb] Use buffered I/O. Writing the DB is now 29 times faster.
...
Saving 100k zlines now takes 72ms instead of 2100ms
Loading 100k zlines now takes 510ms instead of 1300ms
2019-06-05 08:53:30 +02:00
Bram Matthys
1f6bb6d3cc
Some benchmarking
2019-06-05 08:45:48 +02:00
Bram Matthys
498f728cbb
[tkldb] If DB is corrupt then rename to .corrupt and start a new one.
...
This, rather than having the module not loaded at all, which could mean,
especially if missed the warning on boot, that you run for weeks or
months without having your TKL's stored, which would be a shame ;)
Also a failure to rename() is not fatal, as it likely means that we
don't have permissions, in such a case you will see a repeated error
every X minutes due to the write, which is good.
2019-06-05 08:22:22 +02:00
Bram Matthys
21f24cc596
Fix for NICK+USER order. Should be correct? Should check identd..
2019-06-04 20:05:27 +02:00
Bram Matthys
5f8dd67051
if( -> if ( :D
...
[skip ci]
2019-06-04 20:04:22 +02:00
Bram Matthys
e9da2eb3cb
[tkldb] "skipped".. why? "expired" :D
...
And don't bother users too much about this, unless in DEBUGMODE.
2019-06-04 20:00:15 +02:00
Bram Matthys
6b1af917fc
Do it the other way around than previous commit. Force 32 bit type.
...
So it's compatible with machines where int is 64bit (ILP64),
mostly for the future I guess.
2019-06-04 19:52:59 +02:00
Bram Matthys
628f367849
tkldb: version field should also be forced 64 bit or you'll have the same
...
problem with porting 32 to 64 again...
2019-06-04 19:34:37 +02:00
GottemHams
52b39acf78
Fixed return values/checks for helper functions/macros, return empty string instead of NULL when reading zero length strings, discard tkl->subtype and store spamf as a char instead of unsigned int, remove rewriting after DB read, also renamed TKLines/TKLs/etc to *-Lines for uniformity with other code
2019-06-03 20:45:56 +02:00
Bram Matthys
13f96b0a57
Small adjustments to tkldb: convert some to safefree(),
...
get rid of sizeof(char) - which is guaranteed to be 1 by C99 and
on any decent compiler and always use MyMallocEx even when it's not
necessary :D.
2019-06-01 08:53:17 +02:00
Bram Matthys
e78e303314
Re-indent tkldb, sorry could not resist :D
2019-06-01 08:46:22 +02:00
Bram Matthys
2556ae9d70
[tkldb] Allow boot without existing database. Change return values to 1/0 (true/false).
2019-06-01 08:39:32 +02:00
GottemHams
c697e2ea99
Renamed m_storetkl to just tkldb
2019-05-31 22:25:18 +02:00
GottemHams
bf6f885b98
Storetkl now also supports the hashed *@IP Z:Line thingy, also added errno calls to all error output
2019-05-31 22:06:59 +02:00
GottemHams
c43a1b15af
Store TS types in a uint64_t before DB writing to prepare the module for a Year 2038 fix, also upgraded num/rewrite ints to 64 bit since they *might* be as big as tklcount
2019-05-31 21:23:19 +02:00
GottemHams
4004152a7a
Updated m_storetkl's descriptions for added clarity
2019-05-28 21:44:27 +02:00
GottemHams
35600fdfa0
Updated storetkl: write DB on a timer instead of hooking TKL_ADD/DEL, better DB format for improved compatibility with future Unreal versions, configurable .db path, support for softbans, write DB to a tempfile first to prevent corruption of existing DB, also applied some misc optimisations/portability improvements
2019-05-28 21:34:11 +02:00
Bram Matthys
6cf386ee87
...
2019-05-27 19:22:04 +02:00
Bram Matthys
9e87f92c64
Fix small memory leak in SJOIN.
2019-05-27 19:20:25 +02:00
Bram Matthys
55a183bde4
Add "PROTOCTL MTAGS" to indicate message-tags & big buffer support.
...
This so we can link to UnrealIRCd 4.x....
2019-05-26 13:56:09 +02:00
Bram Matthys
57fd5f4f2b
Add HOOKTYPE_IS_HANDSHAKE_FINISHED: if a module returns 0 then register_user()
...
will not be called. This is used, for example, by m_cap when the CAP LS
handshake is still in progress. Modules can add their own requirements
as they see fit.
Note that, as for (CAP) functionality, this adds nothing new, it just
implements it in a cleaner way, rather than all over the place,
like in UnrealIRCd 4.x.
2019-05-26 12:07:44 +02:00
Bram Matthys
dde1cf3194
Fix some mtag FIXME's.
2019-05-26 11:45:58 +02:00
Bram Matthys
622cb43a48
Manual audit of exit_client() done, for mtags.
2019-05-26 11:36:40 +02:00
Bram Matthys
61b15d9f4d
Mass update (automatic) of exit_client().
...
Next step is manual audit...
2019-05-26 10:45:54 +02:00
Bram Matthys
9f54a19801
New unified function for common: sendto_local_common_channels()
...
and make this support mtags so it now works for NICK, ACCOUNT, AWAY.
Still to do: exit client for QUIT.
2019-05-26 10:08:02 +02:00
Bram Matthys
39cd11f504
Fix OOB read due to message tag with trailing backslash.
2019-05-25 15:48:33 +02:00
Bram Matthys
39af766ced
Add a FIXME
2019-05-25 15:40:10 +02:00
Bram Matthys
a74bae0447
Some cleaning in m_sajoin. Whitespace and if() order.
2019-05-25 12:32:18 +02:00
Bram Matthys
1108b58951
Remove old TRE regex engine. Hasn't been maintained since 2010
...
and has various outstanding crash and 100% CPU issues.
We have been encouraging the PCRE2 engine since the start of
UnrealIRCd 4 already.
TRE is being phased out of U4 by the end of the year, so we can
safely remove it in U5 already.
2019-05-25 10:42:46 +02:00
Bram Matthys
a2f37722ae
Fix unitialized variable issues in message-tags handling.
2019-05-25 09:08:43 +02:00
Bram Matthys
8b1cd80700
Make labeled-response work again after API change.
...
TODO: handle both draft/ and without draft/, maybe upstream?
2019-05-25 09:08:26 +02:00
Bram Matthys
427885681d
Make account-tag not inherit. I don't think there's a bug right now,
...
but it's not logical and makes it too easy to make a mistake.
2019-05-25 08:05:26 +02:00
Bram Matthys
daab5abc92
Manual audit of sendto_one(): add mtags support where necessary.
2019-05-24 21:09:55 +02:00
Bram Matthys
6e5df1a4c0
Add mtags argument to sendto_one(). Phase 1 (automated), next is manual
...
audit of all sendto_one's. Also it doesn't work yet...
2019-05-24 17:38:48 +02:00
Bram Matthys
c307d6c61b
Make WHOX the default. Warn if you try to load both modules.
...
Now uses CommandAdd() instead of an override, which was just an
interim solution earlier.
2019-05-23 19:08:49 +02:00
i
c528b22cdd
CIDR support for /WHOX ip matching.
2019-05-22 23:01:55 +03:00
Bram Matthys
418b42e5bf
More sendnumeric() and sendnumericfmt() conversions.
2019-05-22 17:09:12 +02:00
Bram Matthys
4a11309344
Transform sendto_one's to sendnumericfmt() - stage 1
2019-05-22 16:39:06 +02:00