commit - fd260404caa7ce174ada663024d19cd789c152b5
commit + d38d153f51738da31d40036c7c48b32d82234018
blob - 00aafe05a170102a3e22053af73861b50b14e112
blob + 4eab2726a04393f40bc08ddec9ecfd4a4d5144c0
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
new_chan = Channel_Create(conf_chan->name);
if (!new_chan) {
- Log(LOG_ERR, "Can't create pre-defined channel \"%s\"",
+ Log(LOG_ERR, "Can't create pre-defined channel \"%s\"!",
conf_chan->name);
continue;
}
- Log(LOG_INFO, "Created pre-defined channel \"%s\"",
+ Log(LOG_INFO, "Created pre-defined channel \"%s\".",
conf_chan->name);
Channel_ModeAdd(new_chan, 'P');
blob - 2114f84ddbc8bcf6a6761db022524b880c6a1d85
blob + d10775a88fad4a39ecb363dc7b6c433b5e497306
--- src/ngircd/client.c
+++ src/ngircd/client.c
assert( Client != NULL );
- if( LogMsg ) txt = LogMsg;
- else txt = FwdMsg;
- if( ! txt ) txt = "Reason unknown.";
+ txt = LogMsg ? LogMsg : FwdMsg;
+ if (!txt)
+ txt = "Reason unknown";
/* netsplit message */
if( Client->type == CLIENT_SERVER ) {
Destroy_UserOrService(c, txt, FwdMsg, SendQuit);
else if( c->type == CLIENT_SERVER )
{
- if( c != This_Server )
- {
- if( c->conn_id != NONE ) Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
- else Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered: %s", c->id, txt );
+ if (c != This_Server) {
+ if (c->conn_id != NONE)
+ Log(LOG_NOTICE|LOG_snotice,
+ "Server \"%s\" unregistered (connection %d): %s.",
+ c->id, c->conn_id, txt);
+ else
+ Log(LOG_NOTICE|LOG_snotice,
+ "Server \"%s\" unregistered: %s.",
+ c->id, txt);
}
/* inform other servers */
}
else
{
- if( c->conn_id != NONE )
- {
- if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
- else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt );
+ if (c->conn_id != NONE) {
+ if (c->id[0])
+ Log(LOG_NOTICE,
+ "Client \"%s\" unregistered (connection %d): %s.",
+ c->id, c->conn_id, txt);
+ else
+ Log(LOG_NOTICE,
+ "Client unregistered (connection %d): %s.",
+ c->conn_id, txt);
} else {
- Log(LOG_WARNING, "Unregistered unknown client \"%s\": %s",
- c->id[0] ? c->id : "(No Nick)", txt );
+ Log(LOG_WARNING,
+ "Unregistered unknown client \"%s\": %s",
+ c->id[0] ? c->id : "(No Nick)", txt);
}
}
if(Client->conn_id != NONE) {
/* Local (directly connected) client */
Log(LOG_NOTICE,
- "%s \"%s\" unregistered (connection %d): %s",
+ "%s \"%s\" unregistered (connection %d): %s.",
Client_TypeText(Client), Client_Mask(Client),
Client->conn_id, Txt);
Log_ServerNotice('c', "Client exiting: %s (%s@%s) [%s]",
}
} else {
/* Remote client */
- LogDebug("%s \"%s\" unregistered: %s",
+ LogDebug("%s \"%s\" unregistered: %s.",
Client_TypeText(Client), Client_Mask(Client), Txt);
if(SendQuit) {
blob - 80b085a83e2f3e4b6108ed36c30c8358ff5ac441
blob + 142cf23a012592332ae6096ae72a093423e98c95
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
My_Connections[idx].host, Conf_Server[server].port,
idx, strerror(err));
- Conn_Close(idx, "Can't connect!", NULL, false);
+ Conn_Close(idx, "Can't connect", NULL, false);
if (ng_ipaddr_af(&Conf_Server[server].dst_addr[0])) {
/* more addresses to try... */
return;
case -1:
Log(LOG_ERR, "SSL connection on socket %d failed!", sock);
- Conn_Close(idx, "Can't connect!", NULL, false);
+ Conn_Close(idx, "Can't connect", NULL, false);
return;
}
ret = ng_ipaddr_init(addr, listen_addrstr, Port);
if (!ret) {
assert(listen_addrstr);
- Log(LOG_CRIT, "Can't bind to [%s]:%u: can't convert ip address \"%s\"",
+ Log(LOG_CRIT, "Can't bind to [%s]:%u: can't convert ip address \"%s\"!",
listen_addrstr, Port, listen_addrstr);
}
return ret;
return -1;
if (bind(sock, (struct sockaddr *)&addr, ng_ipaddr_salen(&addr)) != 0) {
- Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s",
+ Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s!",
ng_ipaddr_tostr(&addr), Port, strerror(errno));
close(sock);
return -1;
Conn_OPTION_ADD( &My_Connections[Idx], CONN_ISCLOSING );
port = ng_ipaddr_getport(&My_Connections[Idx].addr);
- Log(LOG_INFO, "Shutting down connection %d (%s) with %s:%d ...", Idx,
+ Log(LOG_INFO, "Shutting down connection %d (%s) with \"%s:%d\" ...", Idx,
LogMsg ? LogMsg : FwdMsg, My_Connections[Idx].host, port);
/* Search client, if any */
in_p = (int)(( in_k * 100 ) / in_z_k );
out_p = (int)(( out_k * 100 ) / out_z_k );
Log(LOG_INFO,
- "Connection %d with %s:%d closed (in: %.1fk/%.1fk/%d%%, out: %.1fk/%.1fk/%d%%).",
+ "Connection %d with \"%s:%d\" closed (in: %.1fk/%.1fk/%d%%, out: %.1fk/%.1fk/%d%%).",
Idx, My_Connections[Idx].host, port,
in_k, in_z_k, in_p, out_k, out_z_k, out_p);
}
#endif
{
Log(LOG_INFO,
- "Connection %d with %s:%d closed (in: %.1fk, out: %.1fk).",
+ "Connection %d with \"%s:%d\" closed (in: %.1fk, out: %.1fk).",
Idx, My_Connections[Idx].host, port,
in_k, out_k);
}
Client_SetHostname(c, My_Connections[new_sock].host);
- Log(LOG_INFO, "Accepted connection %d from %s:%d on socket %d.",
+ Log(LOG_INFO, "Accepted connection %d from \"%s:%d\" on socket %d.",
new_sock, My_Connections[new_sock].host,
ng_ipaddr_getport(&new_addr), Sock);
Account_Connection();
#endif
len = read(My_Connections[Idx].sock, readbuf, sizeof(readbuf));
if (len == 0) {
- Log(LOG_INFO, "%s:%u (%s) is closing the connection ...",
- My_Connections[Idx].host,
- (unsigned int) ng_ipaddr_getport(&My_Connections[Idx].addr),
- ng_ipaddr_tostr(&My_Connections[Idx].addr));
- Conn_Close(Idx,
- "Socket closed!", "Client closed connection",
- false);
+ LogDebug("Client \"%s:%u\" is closing connection %d ...",
+ My_Connections[Idx].host,
+ ng_ipaddr_tostr(&My_Connections[Idx].addr), Idx);
+ Conn_Close(Idx, NULL, "Client closed connection", false);
return;
}
if( errno == EAGAIN ) return;
Log(LOG_ERR, "Read error on connection %d (socket %d): %s!",
Idx, My_Connections[Idx].sock, strerror(errno));
- Conn_Close(Idx, "Read error!", "Client closed connection",
+ Conn_Close(Idx, "Read error", "Client closed connection",
false);
return;
}
blob - cce6ef536557e7376bf93a1a8df9f912218ae0e4
blob + dab3043983364e6997effff4055eab9c8a1400a9
--- src/ngircd/io.c
+++ src/ngircd/io.c
io_masterfd = kqueue();
Log(LOG_INFO,
- "IO subsystem: kqueue (initial maxfd %u, masterfd %d)",
+ "IO subsystem: kqueue (initial maxfd %u, masterfd %d).",
eventsize, io_masterfd);
if (io_masterfd >= 0)
library_initialized = true;
blob - 80a6627fcccf43fa91e25c730922ce5d98996122
blob + e7d83eff301c3491c83d71f9892944c0f6e5c480
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
}
if (target != Client) {
- Client_Destroy(target, "Got QUIT command.",
+ Client_Destroy(target, "Got QUIT command",
Req->argc == 1 ? quitmsg : NULL, true);
return CONNECTED;
} else {
- Conn_Close(Client_Conn(Client), "Got QUIT command.",
+ Conn_Close(Client_Conn(Client), "Got QUIT command",
Req->argc == 1 ? quitmsg : NULL, true);
return DISCONNECTED;
}
}
/* User, Service, or not yet registered */
- Conn_Close(Client_Conn(Client), "Got QUIT command.",
+ Conn_Close(Client_Conn(Client), "Got QUIT command",
Req->argc == 1 ? quitmsg : NULL, true);
return DISCONNECTED;
if (Client_Type(Client) == CLIENT_SERVER && Conn_LastPing(conn) == 0) {
Log(LOG_INFO,
- "Synchronization with \"%s\" done (connection %d): %ld seconds [%ld users, %ld channels]",
+ "Synchronization with \"%s\" done (connection %d): %ld second%s [%ld users, %ld channels].",
Client_ID(Client), conn, time(NULL) - Conn_GetSignon(conn),
+ time(NULL) - Conn_GetSignon(conn) == 1 ? "" : "s",
Client_UserCount(), Channel_CountVisible(NULL));
Conn_UpdatePing(conn);
} else
r.argv[1] = Reason;
r.argc = 2;
- Log(LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s",
+ Log(LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s!",
Nick, Reason);
IRC_KILL(Client_ThisServer(), &r);
blob - a587c52f6de794482e5e732e689c2e4dff27d47b
blob + 0a9e930d816f696b5fc784fa6857c063fbf49744
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
if (Req->argv[1][0])
if (Client_NextHop(from) != Client || con > NONE)
- snprintf(msg, sizeof(msg), "%s (SQUIT from %s)",
+ snprintf(msg, sizeof(msg), "\"%s\" (SQUIT from %s)",
Req->argv[1], Client_ID(from));
else
strlcpy(msg, Req->argv[1], sizeof(msg));
logmsg[0] = '\0';
if (!strchr(msg, '('))
snprintf(logmsg, sizeof(logmsg),
- "%s (SQUIT from %s)", Req->argv[1],
+ "\"%s\" (SQUIT from %s)", Req->argv[1],
Client_ID(from));
Client_Destroy(target, logmsg[0] ? logmsg : msg,
msg, false);
blob - e76abcb8a4af00250d819d00d332ca4a5cdc0f65
blob + 37df06873bb30e99c78d91c360d23a09b9bbfec1
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
if (Client != Client_ThisServer())
Log(LOG_NOTICE|LOG_snotice,
- "Got KILL command from \"%s\" for \"%s\": %s",
+ "Got KILL command from \"%s\" for \"%s\": \"%s\".",
Client_Mask(prefix), Req->argv[0], Req->argv[1]);
/* Build reason string: Prefix the "reason" if the originator is a
blob - dfae3366d1f72655cc8cc0e51088b369d9218114
blob + e28c370b47af675ab000cf28bf9add9e0afc529d
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
len = snprintf(pidbuf, sizeof pidbuf, "%ld\n", (long)pid);
if (len < 0 || len >= (int)sizeof pidbuf) {
- Log(LOG_ERR, "Error converting pid");
+ Log(LOG_ERR, "Error converting process ID!");
close(pidfd);
return;
}
if (write(pidfd, pidbuf, (size_t)len) != (ssize_t)len)
- Log( LOG_ERR, "Can't write PID file (%s): %s", Conf_PidFile, strerror( errno ));
+ Log(LOG_ERR, "Can't write PID file (%s): %s!", Conf_PidFile,
+ strerror(errno));
- if( close(pidfd) != 0 )
- Log( LOG_ERR, "Error closing PID file (%s): %s", Conf_PidFile, strerror( errno ));
+ if (close(pidfd) != 0)
+ Log(LOG_ERR, "Error closing PID file (%s): %s!", Conf_PidFile,
+ strerror(errno));
} /* Pidfile_Create */
/* Change root */
if (Conf_Chroot[0]) {
if (chdir(Conf_Chroot) != 0) {
- Log(LOG_ERR, "Can't chdir() in ChrootDir (%s): %s",
+ Log(LOG_ERR, "Can't chdir() in ChrootDir (%s): %s!",
Conf_Chroot, strerror(errno));
goto out;
}
if (chroot(Conf_Chroot) != 0) {
Log(LOG_ERR,
- "Can't change root directory to \"%s\": %s",
+ "Can't change root directory to \"%s\": %s!",
Conf_Chroot, strerror(errno));
goto out;
} else {
if (setgid(Conf_GID) != 0) {
real_errno = errno;
grp = getgrgid(Conf_GID);
- Log(LOG_ERR, "Can't change group ID to %s(%u): %s",
+ Log(LOG_ERR, "Can't change group ID to %s(%u): %s!",
grp ? grp->gr_name : "?", Conf_GID,
strerror(errno));
if (real_errno != EPERM)
if (setuid(Conf_UID) != 0) {
real_errno = errno;
pwd = getpwuid(Conf_UID);
- Log(LOG_ERR, "Can't change user ID to %s(%u): %s",
+ Log(LOG_ERR, "Can't change user ID to %s(%u): %s!",
pwd ? pwd->pw_name : "?", Conf_UID,
strerror(errno));
if (real_errno != EPERM)
setpgrp(0, getpid());
#endif
if (chdir("/") != 0)
- Log(LOG_ERR, "Can't change directory to '/': %s",
+ Log(LOG_ERR, "Can't change directory to '/': %s!",
strerror(errno));
/* Detach stdin, stdout and stderr */
pwd->pw_dir);
else
Log(LOG_INFO,
- "Notice: Can't change working directory to \"%s\": %s",
+ "Notice: Can't change working directory to \"%s\": %s!",
pwd->pw_dir, strerror(errno));
} else
Log(LOG_ERR, "Can't get user informaton for UID %d!?", Conf_UID);