summaryrefslogtreecommitdiff
path: root/functions.c
AgeCommit message (Collapse)Author
5 daysMake NOTICE alerts about client (dis)connection and authentication events ↵Luke Bratch
optional. New configuration options added: - alertconnect - alertauthfail - alertauthsuccess - alertunautheddisconnect - alertautheddisconnect
2024-03-30Implement changing client-side TLS certificate and key paths, and reloading ↵Luke Bratch
certificate/key at runtime when doing a REHASH (BLABOUNCER command or SIGHUP).
2024-03-29Sanity check that the requested fd is greater than zero in arrindex().Luke Bratch
2023-04-08Improve stdin handling (only available when running in foreground mode) - ↵Luke Bratch
don't get stuck in a loop when handling EOF/^D/Ctrl+D, improve debug output, improve comments, initialise variables more safely, exit main loop on errors.
2023-03-23Don't try to sockread() or socksend() if the file descriptor is NULL, assume ↵Luke Bratch
all socksend() return values of <0 are errors, correct (currently unused) return values in sendtoserver().
2022-11-25Fix broken debugprint() call in isnickinanychannel() which was referencing a ↵Luke Bratch
non-existent printf string.
2022-11-25Implement fake QUIT handling via a NOTICE when doing a replay.Luke Bratch
Since user QUIT messages don't contain channel names, clients that didn't know which channels a nick was in when receiving a quit message for that nick can't show a per-channel QUIT notification. Some clients just display the QUIT message in the server status window, others silently ignore it. Cater for those clients by sending a NOTICE about the QUIT rather than replaying it - assuming the nick isn't still in any of our channels.
2022-11-24Fix replaymode = "lastspoke" by using line numbers rather than time to ↵Luke Bratch
calculate replay start point. Introduce new function doreplaylastspoke() to achieve this, move doreplay() into replay.c as doreplaytime() and refactor common things into sanitisereplay().
2022-11-23Correct comments in functions.c.Luke Bratch
2022-09-02Deal with servers only sending a nick rather than nick!user@host as the last ↵Luke Bratch
token of greeting 001.
2022-09-02Improve comment/debug clarity.Luke Bratch
2021-01-25Use a space followed by a colon to determine the final parameter in ↵Luke Bratch
extractfinalparameter(). This fixes the topic being stored incorrectly when the setter's host is a raw IPv6 address.
2021-01-19Fix various issues where strncmp was only comparing a substring.Luke Bratch
This fixes issues such as when JOINing a channel whose name is a substring of another channel, things like PARTing don't work properly.
2021-01-18Make the "channels" configuration file entry an array.Luke Bratch
2020-10-21Don't have arrindex() return 0 on failure as 0 is a valid index. Instead ↵Luke Bratch
return -1 and change callers to check this.
2020-01-05Fix some situations where the remote IP of a connecting/disconnecting client ↵Luke Bratch
is wrong in the debug log and NOTICEs.
2020-01-05Correct a comment.Luke Bratch
2019-12-22Significantly reduce memory usage by only initialising channel struct ↵Luke Bratch
elements when they are used for the first time.
2019-12-22Make full debug output optional for extractnickfromprefix() and ↵Luke Bratch
stripprefix() to avoid huge debug logs when using replaymode = "lastspoke" combined with DEBUG_FULL.
2019-10-02Try to make removenickfromallchannels() much faster when another user QUITs ↵Luke Bratch
by ignoring unused channel indexes.
2019-09-16Make all log filenames lowercase - since IRC nicks and channel names are ↵Luke Bratch
case-insensitive, we can ensure a nick/channel with varying case always ends up in the same log file.
2019-09-15Make sure nicks passed to the "update all channels" functions have non-zero ↵Luke Bratch
lengths to avoid an enormous loop.
2019-09-15Don't try to socksend() in sendtoclient() if the client wasn't found in the ↵Luke Bratch
client array.
2019-09-15Start tracking nicks in channels (upon JOIN/PART/QUIT/NICK) and use that to ↵Luke Bratch
correctly log QUITs in the replay log and normal log(s).
2019-09-14Specify multiple nicks using a configuration array instead of multiple ↵Luke Bratch
individual settings.
2019-09-14Handle ignoring replay messages from before we launched better to avoid ↵Luke Bratch
misleading error messages going to clients.
2019-09-07Avoid more replay log NICK synchronisation issues by ignoring replay log ↵Luke Bratch
nick changes from us if not our current nick, and by completely ignoring replaying any type of replay log line from before blabouncer was launched.
2019-09-07Add a configuration option to include the date in the timestamp when ↵Luke Bratch
replaying the replay log.
2019-09-06Send remote IP addresses instead of fd numbers in NOTICEs to clients and ↵Luke Bratch
print both in related debugprint()s.
2019-07-18Fix compiler warnings emitted by Clang/LLVM and some older GCC versions.Luke Bratch
2019-07-10Fix some potential buffer overflows when sending to client/server.Luke Bratch
2019-07-10Ensure log filenames are safe for writing.Luke Bratch
2019-07-10Make setting configuration option "replayseconds" optional if "replaymode" ↵Luke Bratch
!= "time".
2019-07-09Make sure debug lines printed to file end with a trailing newline.Luke Bratch
2019-07-09Avoid SSL_accept() blocking if the client fails to do TLS negotiation.Luke Bratch
2019-06-17Implement a per-client identifier so auto replay can replay everything a ↵Luke Bratch
given client has missed.
2019-06-16Correctly return success when handling new replay modes.Luke Bratch
2019-06-16Implement two new auto replay modes:Luke Bratch
- replaymode = "noclients": All messages since the bouncer last had no clients connected - replaymode = "lastchange": All messages since the last client connect or disconnect
2019-06-16Handle very long lines and very short lines. Print to terminal if we fail ↵Luke Bratch
to connect to server at startup. Don't print to terminal if sending to a client or to the server fails.
2019-06-16Load all settings from configuration file at startup instead of reading it ↵Luke Bratch
for certain settings (password/nick/nick2/nick3).
2019-06-12Allow reloading the configuration file at runtime using a BLABOUNCER command ↵Luke Bratch
or by issuing the SIGHUP signal.
2019-06-12Don't print a message to the terminal when a channel already exists (it is a ↵Luke Bratch
normal occurence when reconnecting, but might be bad in some other situation).
2019-06-11Implement configurable auto replay modes. So far there is "none", "time" ↵Luke Bratch
(auto replay the last X seconds), and "lastspoke" (auto replay everything since you last spoke).
2019-06-11Refactoring - rename ircdstrings struct to ircdstate since it doesn't just ↵Luke Bratch
contain strings.
2019-06-11Prepend timestamps when writing to the debug log file.Luke Bratch
2019-06-10Refactoring - split giant processircmessage() switch statement into separate ↵Luke Bratch
server and client functions in message.h/message.c.
2019-06-10Refactoring - move most functions into functions.h/functions.c except ↵Luke Bratch
connect/exit functions only relevant in main.c.
2019-06-10Add copyright and GPL 3 notices.Luke Bratch
2019-06-01Put debug logs in subdirectory and have max number to keep be configurable. ↵Luke Bratch
Also fix possible crash in debugprint() if debug directory doesn't exist yet.
2019-05-30Remove most (all?) exit()s with error handling without exiting where ↵Luke Bratch
possible. Convert most remaining printing to stdout/stderr to debugprint() instead.