1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 08:03:12 +02:00

Newlog: convert remaining sendto_ops_and_log()

This commit is contained in:
Bram Matthys
2021-08-11 19:09:07 +02:00
parent ccfad0eed0
commit edfd0d434f
5 changed files with 24 additions and 15 deletions
+5 -6
View File
@@ -175,12 +175,10 @@ void reinit_resolver(Client *client)
{
EventDel(unrealdns_timeout_hdl);
sendto_ops_and_log("%s requested reinitalization of resolver!", client->name);
sendto_realops("Destroying resolver channel, along with all currently pending queries...");
unreal_log(ULOG_INFO, "dns", "REINIT_RESOLVER", client,
"$client requested reinitalization of the DNS resolver");
ares_destroy(resolver_channel);
sendto_realops("Initializing resolver again...");
init_resolver(0);
sendto_realops("Reinitalization finished successfully.");
}
void unrealdns_addreqtolist(DNSReq *r)
@@ -407,8 +405,9 @@ void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct host
!(ip = inetntop(r->ipv6 ? AF_INET6 : AF_INET, he->h_addr_list[0], ipbuf, sizeof(ipbuf))))
{
/* Illegal response -- fatal */
sendto_ops_and_log("Unable to resolve hostname '%s', when trying to connect to server %s.",
r->name, r->linkblock->servername);
unreal_log(ULOG_ERROR, "link", "LINK_ERROR_RESOLVING", NULL,
"Unable to resolve hostname $link_block.hostname, when trying to connect to server $link_block.",
log_data_link_block(r->linkblock));
unrealdns_freeandremovereq(r);
return;
}
+4 -2
View File
@@ -1080,8 +1080,10 @@ void floodprottimer_add(Channel *channel, char mflag, time_t when)
{
if (strlen(chp->timers_running)+1 >= sizeof(chp->timers_running))
{
sendto_ops_and_log("floodprottimer_add: too many timers running for %s (%s)!!!",
channel->name, chp->timers_running);
unreal_log(ULOG_WARNING, "flood", "BUG_FLOODPROTTIMER_ADD", NULL,
"[BUG] floodprottimer_add: too many timers running for $channel ($timers_running)",
log_data_channel("channel", channel),
log_data_string("timers_running", chp->timers_running));
return;
}
strccat(chp->timers_running, mflag); /* bounds already checked ^^ */
+5 -4
View File
@@ -1504,9 +1504,10 @@ char *hbm_history_filename(HistoryLogObject *h)
#define WARN_WRITE_ERROR(fname) \
do { \
sendto_ops_and_log("[history] Error writing to temporary database file " \
"'%s': %s (DATABASE NOT SAVED)", \
fname, unrealdb_get_error_string()); \
unreal_log(ULOG_ERROR, "history", "HISTORYDB_FILE_WRITE_ERROR", NULL, \
"[historydb] Error writing to temporary database file $filename: $system_error", \
log_data_string("filename", fname), \
log_data_string("system_error", unrealdb_get_error_string())); \
} while(0)
#define W_SAFE(x) \
@@ -1584,7 +1585,7 @@ static int hbm_write_db(HistoryLogObject *h)
#endif
if (rename(tmpfname, realfname) < 0)
{
sendto_ops_and_log("[history] Error renaming '%s' to '%s': %s (HISTORY NOT SAVED)",
config_error("[history] Error renaming '%s' to '%s': %s (HISTORY NOT SAVED)",
tmpfname, realfname, strerror(errno));
return 0;
}
+8 -2
View File
@@ -79,8 +79,14 @@ int dead_socket(Client *to, char *notice)
return -1; /* don't overwrite & don't send multiple times */
if (!IsUser(to) && !IsUnknown(to) && !IsClosing(to))
sendto_ops_and_log("Link to server %s (%s) closed: %s",
to->name, to->ip?to->ip:"<no-ip>", notice);
{
/* Looks like a duplicate error message to me?
* If so, remove it here.
*/
unreal_log(ULOG_ERROR, "link", "LINK_CLOSING", to,
"Link to server $client.detail closed: $reason",
log_data_string("reason", notice));
}
safe_strdup(to->local->error_str, notice);
return -1;
}
+2 -1
View File
@@ -470,7 +470,8 @@ void completed_connection(int fd, int revents, void *data)
if (!aconf)
{
sendto_ops_and_log("Lost configuration for %s", get_client_name(client, FALSE));
unreal_log(ULOG_ERROR, "link", "BUG_LOST_CONFIGURATION_ON_CONNECT", client,
"Lost configuration while connecting to $client.details");
return;
}