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

Newlog: channel.c, send.c, support.c, windows/gui.c

This commit is contained in:
Bram Matthys
2021-08-11 17:12:11 +02:00
parent 11755b2093
commit ca3c91ca17
4 changed files with 25 additions and 20 deletions
+4 -4
View File
@@ -1105,10 +1105,10 @@ void set_channel_mlock(Client *client, Channel *channel, const char *newmlock, i
* int ret;
* for (ret = parse_chanmode(&pm, modebuf, parabuf); ret; ret = parse_chanmode(&pm, NULL, NULL))
* {
* ircd_log(LOG_ERROR, "Got %c%c %s",
* pm.what == MODE_ADD ? '+' : '-',
* pm.modechar,
* pm.param ? pm.param : "");
* unreal_log(ULOG_INFO, "test", "TEST", "Got %c%c %s",
* pm.what == MODE_ADD ? '+' : '-',
* pm.modechar,
* pm.param ? pm.param : "");
* }
* @endcode
*/
+14 -8
View File
@@ -284,14 +284,17 @@ void sendbufto_one(Client *to, char *msg, unsigned int quick)
p = strchr(msg+1, ' ');
if (!p)
{
ircd_log(LOG_ERROR, "[BUG] sendbufto_one(): Malformed message: %s",
msg);
unreal_log(ULOG_WARNING, "send", "SENDBUFTO_ONE_MALFORMED_MSG", to,
"Malformed message to $client: $buf",
log_data_string("buf", msg));
return;
}
if (p - msg > 4094)
{
ircd_log(LOG_ERROR, "[BUG] sendbufto_one(): Oversized message-tag (len %d)",
(int)(p - msg));
unreal_log(ULOG_WARNING, "send", "SENDBUFTO_ONE_OVERSIZED_MSG", to,
"Oversized message to $client (length $length): $buf",
log_data_integer("length", p - msg),
log_data_string("buf", msg));
return;
}
p++; /* skip space character */
@@ -312,7 +315,10 @@ void sendbufto_one(Client *to, char *msg, unsigned int quick)
if (len >= 10240)
{
ircd_log(LOG_ERROR, "sendbufto_one: len=%d, quick=%u", len, quick);
unreal_log(ULOG_WARNING, "send", "SENDBUFTO_ONE_OVERSIZED_MSG2", to,
"Oversized message to $client (length $length): $buf",
log_data_integer("length", len),
log_data_string("buf", msg));
#ifdef DEBUGMODE
abort();
#else
@@ -326,9 +332,9 @@ void sendbufto_one(Client *to, char *msg, unsigned int quick)
p = strchr(msg, '\r');
if (p) *p = '\0';
snprintf(tmp_msg, 500, "Trying to send data to myself! '%s'", msg);
ircd_log(LOG_ERROR, "%s", tmp_msg);
sendto_ops("%s", tmp_msg); /* recursion? */
unreal_log(ULOG_WARNING, "send", "SENDBUFTO_ONE_ME_MESSAGE", to,
"Trying to send data to myself: $buf",
log_data_string("buf", tmp_msg));
return;
}
+5 -7
View File
@@ -50,9 +50,7 @@ char *my_itoa(int i)
* @section Ex1 Example
* @code
* for (name = strtoken(&p, buf, ","); name; name = strtoken(&p, NULL, ","))
* {
* ircd_log(LOG_ERROR, "Got: %s", name);
* }
* unreal_log(ULOG_INFO, "test", "TEST", "Got: %s", name);
* @endcode
*/
char *strtoken(char **save, char *str, char *fs)
@@ -714,11 +712,11 @@ void outofmemory(size_t bytes)
if (log_attempt)
{
/* This will probably fail, but we can try... */
unreal_log(ULOG_ERROR, "main", "OUT_OF_MEMORY", NULL,
"Out of memory while trying to allocate $bytes bytes!",
log_data_integer("bytes", bytes));
log_attempt = 0;
if (bytes)
ircd_log(LOG_ERROR, "Out of memory while trying to allocate %lld bytes!", (long long)bytes);
else
ircd_log(LOG_ERROR, "Out of memory");
}
exit(7);
}
+2 -1
View File
@@ -169,7 +169,8 @@ LRESULT RESubClassFunc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
int DoCloseUnreal(HWND hWnd)
{
ircd_log(LOG_ERROR, "Stopping UnrealIRCd...");
unreal_log(ULOG_INFO, "main", "UNREALIRCD_STOP", NULL,
"Terminating server (process termination requested or GUI window closed)");
loop.ircd_terminating = 1;
unload_all_modules();
DestroyWindow(hWnd);