Hi,

some other trivial patches for cygnal, fix the behavior for the admin
handler.

Summary:

* cygnal-manage-help-with-others-cmds.patch

Move the HELP command management togheter with the other ones for
consistency, and manage the case when the command is unknown.

* cygnal-correctly-manage-unknown-cmds.patch

If the command is unknown then the enum cmd has to be set to it,
otherwise it will keep the value previously assigned.

* cygnal-remove-stats-from-help-msg.patch

The "statistics" command is not implemented, so don't mention in the
help message.
Index: trunk/cygnal/cygnal.cpp
===================================================================
--- trunk.orig/cygnal/cygnal.cpp	2009-10-23 19:13:39.000000000 +0200
+++ trunk/cygnal/cygnal.cpp	2009-10-23 19:20:09.000000000 +0200
@@ -664,7 +664,6 @@
 		    cmd = Handler::STATUS;
 		} else if (strncmp(ptr, "HELP", 2) == 0) {
 		    cmd = Handler::HELP;
-		    net.writeNet("commands: help, status, poll, interval, statistics, quit.\n");
 		} else if (strncmp(ptr, "POLL", 2) == 0) {
 		    cmd = Handler::POLL;
 		} else if (strncmp(ptr, "INTERVAL", 2) == 0) {
@@ -736,7 +735,11 @@
 	      case Handler::INTERVAL:
 		  net.writeNet("set interval\n");
 		  break;
+	      case Handler::HELP:
+		  net.writeNet("commands: help, status, poll, interval, statistics, quit.\n");
+		  break;
 	      default:
+		  net.writeNet("Unknown command, try with the 'help' command for getting some help\n");
 		  break;
 	    };
 	} while (ret > 0);
Index: trunk/cygnal/cygnal.cpp
===================================================================
--- trunk.orig/cygnal/cygnal.cpp	2009-10-23 19:14:18.000000000 +0200
+++ trunk/cygnal/cygnal.cpp	2009-10-23 19:14:44.000000000 +0200
@@ -668,7 +668,8 @@
 		    cmd = Handler::POLL;
 		} else if (strncmp(ptr, "INTERVAL", 2) == 0) {
 		    cmd = Handler::INTERVAL;
-		}
+		} else
+		    cmd = Handler::UNKNOWN;
 	    }
 	    switch (cmd) {
 		// close this connection
Index: trunk/cygnal/cygnal.cpp
===================================================================
--- trunk.orig/cygnal/cygnal.cpp	2009-10-23 19:16:26.000000000 +0200
+++ trunk/cygnal/cygnal.cpp	2009-10-23 19:16:34.000000000 +0200
@@ -737,7 +737,7 @@
 		  net.writeNet("set interval\n");
 		  break;
 	      case Handler::HELP:
-		  net.writeNet("commands: help, status, poll, interval, statistics, quit.\n");
+		  net.writeNet("commands: help, status, poll, interval, quit.\n");
 		  break;
 	      default:
 		  net.writeNet("Unknown command, try with the 'help' command for getting some help\n");
_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to