Bram Matthys
58cd2d8bfd
Add some comments and add a redundant check for parameter writing.
...
Better to be safe than to accidentally write OOB.
2021-08-22 19:43:36 +02:00
Bram Matthys
49955670d9
Use do_mode_char_write() at two more places.
2021-08-22 19:38:18 +02:00
Bram Matthys
6f62a967fa
More code cleanups in mode.c: this splits do_mode_char() up between
...
do_mode_char_list_mode() and do_mode_char_member_mode(), which are
two quite different things.
And rewrite do_mode_char_member_mode() to get rid of switch/case
style and the goto.
Also add do_mode_char_write() which is used at 5 places (could be
expanded, probably).
2021-08-22 19:33:33 +02:00
Bram Matthys
52b4a44e94
Massively rename Cmode.flag to Cmode.letter.
...
(similar to 5a387f9c0b )
2021-08-22 18:45:13 +02:00
Bram Matthys
9838378550
Massive rename of:
...
* channel->mode.extmode to channel->mode.mode
* channel->mode.extmodeparams to channel->mode.mode_params
This because all channel modes that are set there are extended channel
modes, only lists are still in core atm and they never get set here.
2021-08-22 18:36:00 +02:00
Bram Matthys
e0504b2e52
Remove Mode.mode, it now only contains Mode.extmode and Mode.extmodeparams
...
Also make MODES_ON_JOIN point to iConf.modes_on_join.extmodes instead
of iConf.modes_on_join.mode
Actually in next commit I may reorder again...
2021-08-22 18:33:25 +02:00
Bram Matthys
fafa58f8c8
Make gcc happy, even though this is a false positive.
2021-08-22 18:24:31 +02:00
Bram Matthys
7e4399a2ef
Some do_mode_char() cleanups, now that it only deals with members/lists.
2021-08-22 18:23:37 +02:00
Bram Matthys
783cc3ff5b
Cmode API: change from Channelmode_Table[<num>] to channelmodes linked list.
...
And now we can easily sort the channel modes too, makes it easier for
our test cases.
2021-08-22 17:57:14 +02:00
k4be
b3fce25955
Documentation update
2021-08-22 17:00:59 +02:00
k4be
50ae1ca2df
Proxy validation by IP address.
...
TODO: add optional password too.
2021-08-22 16:46:52 +02:00
Bram Matthys
96b290536e
Rename Channelmode_Table.slot to .param_slot since this is only
...
about parameter slot mapping.
2021-08-22 16:37:18 +02:00
k4be
e205e14279
Query DNS for hostname of forwarded users (seems to work)
2021-08-22 15:05:22 +02:00
k4be
7ed45c5921
Make websocket_parse_forwarded_header return a pointer
2021-08-22 14:20:36 +02:00
Bram Matthys
d35a90c80f
Fix various channel modes showing up as duplicate in 004 and 005.
...
Yeah I forgot we hardcoded these somewhere, now they are gone.. poof!
2021-08-22 14:06:51 +02:00
Bram Matthys
39ed0520cc
Fix compiler warning/crash
2021-08-22 13:50:02 +02:00
Bram Matthys
aac3c407bf
I forgot a forward declaration..
2021-08-22 13:45:32 +02:00
Bram Matthys
3a464e34ff
Some minor reordering
2021-08-22 13:36:46 +02:00
k4be
a2cdb8ff89
Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev
2021-08-22 13:36:06 +02:00
k4be
be78ecebfc
Parse "Forwarded:" header from proxy.
...
Not (yet) checking source address nor getting a hostname.
2021-08-22 13:34:54 +02:00
Bram Matthys
85d7a2556a
Move list mode requests like "MODE #channel b" to list_mode_request()
...
which uses send_list_mode() and send_user_list_mode() for
+beI and +aq respectively.
2021-08-22 13:32:37 +02:00
Bram Matthys
5c114d0069
Cleanup old channel mode stuff, now that all non-list-modes are gone.
...
Eg no longer need to walk through the corechannelmodetable for
single param channel modes...
Also fix sjoin comments about "their" and "our" modes. In the merge
case this was not correct, it was "our old" and "merged modes".
2021-08-22 13:15:08 +02:00
Bram Matthys
8a5a0723e9
Fix the default set::modes-on-join (+nt) not working anymore, since
...
at the time of setting the default settings the channel mode modules
are not fully initialized yet.
2021-08-22 13:12:55 +02:00
Bram Matthys
1a19de2de9
Move channel mode +r to module chanmodes/isregistered
2021-08-22 12:19:07 +02:00
Bram Matthys
57ec565051
Move channel mode +t to module chanmodes/topiclimit
...
TODO: move code from "topic" module to here, some hook call.
2021-08-22 12:09:53 +02:00
Bram Matthys
6dd539d760
Move channel mode +m to module chanmodes/moderated
...
(and nearly all the code related to it)
2021-08-22 12:01:54 +02:00
Bram Matthys
24f73c28e4
Move channel mode +l to module chanmodes/limit
...
(and all the code related to it)
2021-08-22 11:45:08 +02:00
Bram Matthys
1533c6431e
Move channel mode +n to module chanmodes/noexternalmsgs
...
(and all the code related to it)
2021-08-22 11:22:33 +02:00
Bram Matthys
8066c13876
Move +s/+p to chanmodes/secret and chanmodes/private.
...
To be honest, the modules don't do much other than handling the
mode stuff, but.. we can look at that again later.
2021-08-22 11:11:26 +02:00
Bram Matthys
374069914e
Fix memory leak in find_invex() due to extban recode from a few
...
weeks ago.
2021-08-22 10:44:29 +02:00
Bram Matthys
295b3505ef
Move channel mode +i to module chanmodes/inviteonly
2021-08-22 10:37:37 +02:00
Bram Matthys
c403a47daf
Move channel mode +k to module chanmodes/key
2021-08-22 10:06:51 +02:00
Bram Matthys
1e8c5da6aa
Add ERR_INVALIDMODEPARAM which is a bit more informative than
...
ERR_CANNOTCHANGECHANMODE since it makes clear the problem is the
parameter and not a permissions issue..
2021-08-22 10:05:49 +02:00
Bram Matthys
021ba807bd
Fix memory leaks in built-in https client and only build SSL_CTX once.
2021-08-21 20:29:38 +02:00
Bram Matthys
ec5f9ee6c3
Add check for missing HTTP/1.X response. Shouldn't happen, but,
...
otherwise the error would be confusing wrt redirects, this is better.
2021-08-21 18:33:14 +02:00
Bram Matthys
8344327cb4
HTTPS client: support Basic authorization
2021-08-21 16:57:38 +02:00
Bram Matthys
6f087093df
Create some more notes regarding the release notes
2021-08-21 16:36:33 +02:00
Bram Matthys
ccc0b3397e
For a remote include, use the URL[*] in any error messages instead
...
of the temporary file. That is, ce->file->name contains the URL.
[*] Any user:pass is censored from the URL via displayurl()
2021-08-21 16:15:41 +02:00
Bram Matthys
ecc3ffe1e2
Parse error in remote include must be a fatal error. It is now (again).
2021-08-21 16:04:55 +02:00
Bram Matthys
24dec75576
Rename the current cloaking module to 'oldcloak'
2021-08-21 14:32:49 +02:00
Bram Matthys
8dc316bd8d
Use SHA256 instead of MD5 in add_entropy_configfile()
2021-08-21 14:28:01 +02:00
Bram Matthys
c821efa477
Get rid of old remote include stuff in windows gui.c, we don't
...
track this anymore.
[skip ci]
2021-08-21 14:14:03 +02:00
Bram Matthys
5b90fd0c0d
Get rid of old MOTD downloading code and several USE_LIBCURL defines
...
that are no longer needed.
2021-08-21 14:13:24 +02:00
Bram Matthys
89b9c2ec32
Deal with HTTP redirects, and add DOWNLOAD_MAX_REDIRECTS to include/config.h
...
which defaults to 2. Make it use this value for both curl and non-curl.
Previously (with curl) it was set to 1, and nobody complained...
2021-08-21 14:05:43 +02:00
Bram Matthys
e28cbb6041
Differentiate between DNS/connect timeout (15s) and transfer timeout (45s).
...
Already done in curl code, now also in non-curl-code.
2021-08-21 13:36:03 +02:00
Bram Matthys
fe08d58dbc
Add SNI support. Verify TLS certificate belongs to the host.
...
(Those were items 7 and 8 on the previously mentioned TODO list)
2021-08-21 13:30:36 +02:00
Bram Matthys
6a6f4120ee
Built-in https client: Deal with Transfer-Encoding: chunked
...
(and also fix a crash if using non-https url)
2021-08-21 13:23:33 +02:00
Bram Matthys
c9c2106bb9
Use SHA256 hash for cache/<object> instead of old MD5
2021-08-21 09:45:44 +02:00
Bram Matthys
090fe76739
URL: Make the curl and non-curl implementation use the same timeouts.
...
These are set in include/config.h to what they already were before:
15 seconds for the connect timeout, 45 for the complete transfer.
2021-08-21 09:37:14 +02:00
Bram Matthys
c9e98137a4
Get rid of url.h and stuff the 6 functions there (which were not even
...
declared as extern) in include/h.h like the rest.
2021-08-21 09:32:17 +02:00