]> git.gir.st - ircpipe.git/log
ircpipe.git
5 weeks agoimplement handler for the usual terminating signals
Tobias Girstmair [Mon, 20 May 2024 15:40:21 +0000 (17:40 +0200)]
implement handler for the usual terminating signals

right now, we just send /QUIT and cleanly shut down the socket. in the
future, this allows us to do something to the socket on SIGUSR{1,2}, for
example.

6 weeks agoinitiate PING if socket idles for too long
Tobias Girstmair [Fri, 17 May 2024 14:55:37 +0000 (16:55 +0200)]
initiate PING if socket idles for too long

note that we only start tracking the monotonic timestamp of last
incoming socket activity in irc_poll(). because of that, we must
initialize recv_ts or we risk never sending the first PING when the
server doesn't send anything after the 001 numeric (e.g. znc with no
joined channels).

there isn't really a reason to configure ping interval/pong timeout, so
we just pick some values.

6 weeks agosimplify sasl handling
Tobias Girstmair [Fri, 17 May 2024 12:10:06 +0000 (14:10 +0200)]
simplify sasl handling

note that we still don't support multiple SASL chunks; the error
handling was just removed from irc_base64() (OR_DIE is incompatible with
assignment). we should probably verify this constraint in main().

6 weeks agodirectly exit from irc_answer() on error, improve error handling
Tobias Girstmair [Sun, 12 May 2024 18:56:26 +0000 (20:56 +0200)]
directly exit from irc_answer() on error, improve error handling

e.g. ERR_YOUREBANNEDCREEP (465) is sent after 001 but before JOIN.

6 weeks agoNULL-terminate read() calls
Tobias Girstmair [Sun, 12 May 2024 18:29:46 +0000 (20:29 +0200)]
NULL-terminate read() calls

we reuse the samme buffer for all network and local read(2)s. irc_answer
(or more specifically, strtok(3)) expects NULL-terminated strings. this
caused us to re-parse older strings when the buffer shrank between two
consecutive read(2) calls.

6 weeks agorework irc_answer to catch specific error replies and exit when encountered
Tobias Girstmair [Sun, 12 May 2024 17:27:08 +0000 (19:27 +0200)]
rework irc_answer to catch specific error replies and exit when encountered

we still need to pass the error line to the OR_DIE_irc macro, so it's
displayed on stderr (stdout is likely redirected).

8 weeks agorename PORT_PLAIN to PORT_TCP
Tobias Girstmair [Fri, 3 May 2024 18:30:09 +0000 (20:30 +0200)]
rename PORT_PLAIN to PORT_TCP

8 weeks agopartially revert IRCv3 USER
Tobias Girstmair [Fri, 3 May 2024 17:14:45 +0000 (19:14 +0200)]
partially revert IRCv3 USER

tilde prefixing to disable ident lookup seems to not be supported by
libera, so don't bother.

8 weeks agouse IRCv3 USER command
Tobias Girstmair [Fri, 3 May 2024 16:56:40 +0000 (18:56 +0200)]
use IRCv3 USER command

* mode must be '0'
* if the client's host does not expose an ident server, the username
  should be prefixed by '~'

living standard document: https://modern.ircdocs.horse/#user-message

2 months agoswitch to RFC2812 style USER command
Tobias Girstmair [Sat, 27 Apr 2024 12:18:17 +0000 (14:18 +0200)]
switch to RFC2812 style USER command

we don't (yet?) allow setting user mode, though.

2 months agoimplement TLS_WANT_POLL{IN,OUT}
Tobias Girstmair [Sat, 27 Apr 2024 10:43:40 +0000 (12:43 +0200)]
implement TLS_WANT_POLL{IN,OUT}

we always listen for POLLIN events, so we don't need to explicitly check
for it. not sure if this implementation is correct. modeled after
https://github.com/openbsd/src/blob/master/usr.bin/nc/netcat.c

2 months agodefend against malformed messages
Tobias Girstmair [Sat, 27 Apr 2024 10:41:31 +0000 (12:41 +0200)]
defend against malformed messages

if a message consists of only the prefix, we'd overrun the buffer.

2 months agodocument password and tls related flags
Tobias Girstmair [Sat, 27 Apr 2024 10:41:11 +0000 (12:41 +0200)]
document password and tls related flags

4 months agoimplement TLS support using libtls or libretls
Tobias Girstmair [Fri, 16 Feb 2024 20:56:12 +0000 (21:56 +0100)]
implement TLS support using libtls or libretls

also fixes some c90 related pedantic warnings and improves error
messages for bad or missing cli parameters.

3 years agoremove debug printfs
Tobias Girstmair [Mon, 28 Dec 2020 16:32:39 +0000 (17:32 +0100)]
remove debug printfs

3 years agouse getaddrinfo() for transparent ipv4/6 support
Tobias Girstmair [Mon, 28 Dec 2020 16:18:22 +0000 (17:18 +0100)]
use getaddrinfo() for transparent ipv4/6 support

introduces a malloc :(

3 years agofix polling standard input
Tobias Girstmair [Mon, 28 Dec 2020 15:15:08 +0000 (16:15 +0100)]
fix polling standard input

3 years agosupport server password (PASS message)
Tobias Girstmair [Mon, 28 Dec 2020 15:00:48 +0000 (16:00 +0100)]
support server password (PASS message)

3 years agoinitial commit
Tobias Girstmair [Wed, 23 Dec 2020 21:16:47 +0000 (22:16 +0100)]
initial commit

Imprint / Impressum