1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 04:46:17 +00:00
Commit Graph

3575 Commits

Author SHA1 Message Date
Alexander Barton
387a29a7fd Don't wait for the network when read buffers possibly hold commands
There is no point in waiting up to one second for the network receiving
new data when there is still a read buffer holding at least one command;
we shouldn't waste time but handle it immediately!
2020-05-04 00:46:56 +02:00
Alexander Barton
54fac57603 Handle commands in the read buffer before reading more data
If there are more bytes in the read buffer already than a single valid
IRC command can get long (513 bytes, COMMAND_LEN), wait for this/those
command(s) to be handled first and don't try to read even more data from
the network (which most probably would overflow the read buffer of this
connection soon).
2020-05-04 00:46:56 +02:00
Alexander Barton
9f05f5ee61 Read_Request(): Clean up code and add some more comments
No functional changes.
2020-05-04 00:46:56 +02:00
Alexander Barton
629a45ee0f Revert "Increase read buffer size for server connections"
This reverts commit c6e3c13f27.

This sounded like the right approach at first, but I'm not that sure
that it really makes sense to have different sizes of read buffers: the
per-connection read buffer only needs to keep data that is needed to
parse one full command, be it plain text, encrypted and/or compressed.
Then ngIRCd should handle this one command, move leftover data to the
beginning of the buffer and read the next chunk from the network that is
missing to get the next complete command (512 bytes at max).

So I revert this for now and try to fix the logic in Read_Request(),
which is broken nevertheless, as it results in servers becoming
disconnected during "server burst" when "big" lists are transferred.
2020-05-04 00:46:56 +02:00
Alexander Barton
8d414b079c Correctly use Config_Error() instead of Log() in Read_Config()
The name of the Config_Error() function is misleading: it is not only
used to show configuraton errors, but all messages shown during normal
operation as well as for "config testing": it takes care of the correct
formatting of the messages (syslog, forground logging, config testing).

This fixes commit bb1d014aba.
2020-05-03 17:08:51 +02:00
Alexander Barton
8a37695bf3 contrib/nglog.sh: Looks like GNU awk (gawk) is needed ... 2020-05-03 17:07:51 +02:00
Alexander Barton
71e9bb1ca6 Update Travis-CI configuration, "sudo" is depreacted 2020-05-03 03:15:56 +02:00
Alexander Barton
0dc692b1f7 Log G-/K-Line changes only when not initiated by a server
This prevents the log from becomming spammed during "net bursts".
2020-05-03 03:15:49 +02:00
Alexander Barton
79a917f954 Set the "last data" time to "last ping" time when updating the latter
This is required because the PING can be received quite a bit earlier
than it is actually handled, for example during "server burst" or other
heavy operations:
So the times won't match and PING-PONG logic would become garbled,
because we test for "last ping > last data" to determine if a PING
already was sent or not.
2020-05-03 03:15:38 +02:00
Johann Hartwig Hauschild
11ea6a5070 updating testsuite to support ssl-tests 2020-04-25 00:04:38 +02:00
Alexander Barton
42e8654d7b INSTALL.md: Add not about removed legacy options 2020-04-20 19:31:57 +02:00
sam_c
1fc54ebef1
Makefile.am: Replace make with ${MAKE} (#270)
Fixes warnings such as:
"warning: jobserver unavailable: using -j1. Add `+' to parent make rule."

Signed-off-by: Sam James (sam_c) <sam@cmpct.info>
2020-04-20 19:29:16 +02:00
Alexander Barton
c2c84a1d26 Update AUTHORS file 2020-04-20 19:25:28 +02:00
Alexander Barton
05324b232f ChangeLog: Add missing patch attribution 2020-04-20 19:25:02 +02:00
Alexander Barton
ea1207238f Update NEWS and ChangeLog files 2020-04-20 19:14:54 +02:00
Alexander Barton
830f00e953 contrib/nglog.sh: Use bash(1) as interpreter
bash(1) is required to handle the forking and output redirection
connectly, sh(1) -- at least dash(1) on Debian -- fails ...

This fixes the last commit, 14777c18c.
2020-04-20 10:01:09 +02:00
Alexander Barton
14777c18cf contrib/nglog.sh: Fork awk(1), deal better with signals (CTRL-C) 2020-04-20 00:55:24 +02:00
Alexander Barton
e4a6bd5099 Update Xcode project for latest Xcode version (11.4.1) 2020-04-20 00:54:06 +02:00
michi
ab62dd27dc Remove legacy configuration options
Remove legacy configuration options and related functions that have
been marked for removal for some time:

- PredefChannelsOnly (v22)
- NoticeAuth (v24)
- NoXXX (v19)
- Old '[GLOBAL]' section handling (v19)
2020-04-20 00:20:50 +02:00
michi
c6e3c13f27 Increase read buffer size for server connections
This applies the same logic we have for write buffers to distinguish
between server and client connections and sets the maximum buffer size
accordingly. As a result peering with servers with many GLINE/KLINEs
does not kill the connecting server connection anymore.
2020-04-20 00:20:46 +02:00
michi
04de1423eb Fix recursion bug on write error
Depending on the stack size, too many clients on the same channel
quitting at the same time would trigger a crash due to too many
recursive calls to Conn_Close().
2020-04-20 00:20:46 +02:00
michi
13b8324c4a Fix hostmask cloaking bug for IPv6 too 2020-04-20 00:20:46 +02:00
michi
f27827d793 Unbreak GCC 10 (-fno-common) build 2020-04-20 00:20:46 +02:00
Hilko Bengen
86f3c563d6 GnuTLS: Eliminate memory leaks for DH parameters, priorities cache
The DH parameters reference has to be stored next to the x509_cred
which holds a reference to it.
2020-04-19 21:20:43 +02:00
Hilko Bengen
eead4a631f Add support for GnuTLS certificate reload
This requires keeping track of currently active certificates, so those
are stored separately, along with a reference counter, and discarded
when they are no longer in use.
2020-04-17 17:34:12 +02:00
Alexander Barton
9c5e42458e Update documentation to reflect "[Channel]->Modes" changes
No longer mention "[Channel]->Key" and "[Channel]->MaxUsers".
2020-03-29 23:17:21 +02:00
Alexander Barton
61ac8be2fd Convert INSTALL and README files to Markdown
This requires some changes to the build system, for example to comply
with the expectations of the GNU autoconf/automake tools ...
2020-03-29 22:33:51 +02:00
Alexander Barton
3aa1d880fe Add deprecation warnings for "Key" and "MaxUsers" in [Channel] 2020-03-29 22:31:18 +02:00
Alexander Barton
ba3b22b851 Test suite: Test multiple "Modes" lines in [Channel] sections 2020-03-29 01:16:37 +01:00
Alexander Barton
4d519cfdbf Predefined channles: Fix handling of legacy configuration options
Fix the handling of legacy "Key" and "MaxUsers" [Channel] settings:

- Activate them before evaluating the "Modes" parameter, to allow the
  latter to override those legacy options.
- Enforce setting the respective +k/+l mode(s) to support the legacy
  "Mode = kl" notation, which was valid but is an invalid MODE string:
  key and limit are missing! So set them manually when "k" or "l" are
  detected in the first MODE parameter.
- Sort modes +kl alphabetically, adjust test suite accordingly.
2020-03-29 00:45:59 +01:00
Alexander Barton
fed22184c5 Enhance logging while setting up predefined channels 2020-03-29 00:30:36 +01:00
michi
a3072ce698 Allow multiple "Modes =" lines per [Channel] section 2020-03-29 00:29:50 +01:00
michi
decf98d5ef Evaluate initial channel modes
Allow setting arbitrary channel modes in the config file.

Closes #55.
2020-03-28 23:47:21 +01:00
Alexander Barton
a77353361b Xcode: add missing files in src/testsuite, and sort them 2020-03-28 23:46:16 +01:00
Alexander Barton
3f7caff630 Add "FNC" (forced nick changes) to ISUPPORT(005) numeric
Most probably this doesn't make any difference to any client, but it
seems correct. See <http://www.irc.org/tech_docs/005.html> for details.
2020-03-22 14:07:32 +01:00
Alexander Barton
8d173a3328 Fix memory leak in portabtest Check_strtok_r()
Fix the following Clang "LeakSanitizer" error (which isn't quite
relevant in this test program, but anyway):

  ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 7 byte(s) in 1 object(s) allocated from:
      #0 0x7f8c4d022810 in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
      #1 0x5601a801491a in Check_strtok_r (/net/arthur/home/alex/Develop/ngIRCd/ngIRCd.git/src/portab/portabtest+0x291a)
      #2 0x5601a8014d77 in main (/net/arthur/home/alex/Develop/ngIRCd/ngIRCd.git/src/portab/portabtest+0x2d77)
      #3 0x7f8c4c69009a in __libc_start_main ../csu/libc-start.c:308

  SUMMARY: AddressSanitizer: 7 byte(s) leaked in 1 allocation(s).
  FAIL: portabtest
2020-02-15 14:56:07 +01:00
michi
e7cb9b1a00 Reuse old SSL key if loading a new one failed 2020-02-15 14:47:20 +01:00
Alexander Barton
c411643d45 Update Xcode project for latest Xcode version (11.3.1) 2020-02-11 20:33:44 +01:00
Alexander Barton
2e1797d5a5 Remove outdated OpenBSD/NetBSD systrace.policy
Systrace was removed from OpenBSD and NetBSD, so remove this (old and
outdated?) configuration file from the ./contrib directory.

See <https://en.wikipedia.org/wiki/Systrace>.

Thanks to "michi" for pointing this out on #ngircd!
2020-02-11 20:31:15 +01:00
Alexander Barton
f5fa7db4ba 2020! 2020-01-21 22:02:40 +01:00
Alexander Barton
22cae1b5fc Enhance handling of command line errors, and "--help" & "--version"
Return with exit code 0 ("no error") when "--help" or "--version" was
used (this resulted in exit code 1, "error" before).

And exit with code 2 ("command line error") for all invalid command
line options, and show the error message on stderr (message was printed
to stdout before, and exit code was 1, "generic error").

This new behaviour is more in line with the GNU "coding standards",
see <https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html>.
2019-12-31 16:34:23 +01:00
Alexander Barton
fb5aa8f652 Fix and update Xcode project
- Reference correct contrib/Makefile.am file
- Correctly sort contrib/nglog.sh
- Add "ORGANIZATIONNAME" setting
2019-12-16 16:57:56 +01:00
Alexander Barton
91e87af605 Update ngindent.sh name in Makefile and Xcode project, too 2019-12-16 16:54:13 +01:00
Alexander Barton
9286686c09 contrib/README: Add nglog.sh script to the list 2019-12-07 01:43:00 +01:00
Alexander Barton
1f69f1d0ab contrib/nglog.sh: Use bright colors for warning & error messages 2019-12-07 01:42:33 +01:00
Alexander Barton
b03fcaab5a contrib/ngindent.sh: Enhance and rename script
Add more GNU indent options for better results, and add the ".sh" suffix
to bring this script in line with the others in the contrib/ folder.
2019-12-07 01:41:39 +01:00
Windree
70eb1ee57d Update install documentation: libgnutls-dev
According https://packages.debian.org/search?keywords=libgnutls28-dev
in Ubuntu and Debian libgnutls-dev package name is libgnutls28-dev

Closes #264.

Thanks Windree!
2019-12-02 00:45:09 +01:00
Alexander Barton
80437b2533 Add simple log colorization script: ./contrib/nglog.sh
This script parses the log output of ngircd(8), and colorizes the
messages accoring to their log level. Example usage:

ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
2019-11-10 22:07:26 +01:00
Alexander Barton
de1de40551 Log received signals (using strsignal(3), when available) 2019-11-10 21:12:43 +01:00
Alexander Barton
4169cb25e6 Make test suite compatible with Haiku 2019-11-03 15:15:59 +01:00