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