Commit a37c6010 authored by Luke Bratch's avatar Luke Bratch
Browse files

Correctly log and NOTICE new connections' remote IP addresses.

parent cbaaaf96
All the TODOs sprinkled throughout the code!
User/channel mode logging.
Make all log filenames lowercase since IRC nick and channel names are case insensitive.
......@@ -797,11 +797,11 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) {
// TODO - Handle the "find a free element" loop not finding a free element
debugprint(DEBUG_FULL, "bouncer-client: new connection from %s on socket %d\n",
clients[arrindex(clients, i)].remoteip, newfd);
clients[arrindex(clients, newfd)].remoteip, newfd);
// Alert other clients about the new connection
char alertmsg[MAXDATASIZE];
if (!snprintf(alertmsg, MAXDATASIZE, "NOTICE %s :blabouncer: new client connected from %s.", ircdstate.ircnick,
clients[arrindex(clients, i)].remoteip)) {
clients[arrindex(clients, newfd)].remoteip)) {
fprintf(stderr, "Error while preparing new client connection NOTICE!\n");
debugprint(DEBUG_CRIT, "Error while preparing new client connection NOTICE!\n");
alertmsg[0] = '\0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment