Skip to content
Snippets Groups Projects
Commit 18ffee62 authored by rswindell's avatar rswindell
Browse files

Log the bogus commands received "Received bogus command: '<cmdline>'" with

a debug-level log message. For Nelgin. Requires debug-log level output enabled.
parent c488727d
Branches
Tags
No related merge requests found
......@@ -143,6 +143,12 @@ function count_msgs(msgbase)
return { total: count, first: first, last: last };
}
function bogus_cmd(cmdline)
{
log(LOG_DEBUG, "Received bogus command: '" + cmdline + "'");
bogus_cmd_counter++;
}
var username='';
var msgbase=null;
var selected=null;
......@@ -159,7 +165,7 @@ if(!no_anonymous)
while(client.socket.is_connected && !quit) {
if(bogus_cmd_counter) {
log(LOG_DEBUG, "Throttling bogus command sending clinet for " + bogus_cmd_counter + " seconds");
log(LOG_DEBUG, "Throttling bogus command sending client for " + bogus_cmd_counter + " seconds");
sleep(bogus_cmd_counter * 1000); // Throttle
}
......@@ -188,7 +194,7 @@ while(client.socket.is_connected && !quit) {
}
if(cmdline=="") { /* ignore blank commands */
bogus_cmd_counter++;
bogus_cmd(cmdline);
continue;
}
......@@ -480,7 +486,7 @@ while(client.socket.is_connected && !quit) {
if(!found) {
writeln("411 no such newsgroup");
log(LOG_NOTICE,"!no such group");
bogus_cmd_counter++;
bogus_cmd(cmdline);
break;
}
......@@ -638,7 +644,7 @@ while(client.socket.is_connected && !quit) {
case "STAT":
if(!selected) {
writeln("412 no newsgroup selected");
bogus_cmd_counter++;
bogus_cmd(cmdline);
break;
}
if(!selected.can_read) {
......@@ -647,7 +653,7 @@ while(client.socket.is_connected && !quit) {
}
if(cmd[1]==undefined || cmd[1].length==0) {
writeln("420 no current article has been selected");
bogus_cmd_counter++;
bogus_cmd(cmdline);
break;
}
if(cmd[1]!='') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment