Forráskód Böngészése

pike: Add error on bad argument

Reported by Ovidiu Sas on the sr-dev list. Bug ported from modules_s/pike :-)
Olle E. Johansson 12 éve
szülő
commit
b6e2034d84
1 módosított fájl, 7 hozzáadás és 1 törlés
  1. 7 1
      modules_k/pike/pike_rpc.c

+ 7 - 1
modules_k/pike/pike_rpc.c

@@ -134,6 +134,12 @@ static void pike_top(rpc_t *rpc, void *c)
 		options |= NODE_STATUS_WARM;
 	}
 	DBG("pike:top: options: 0x%02x\n", options);
+
+
+	if (options == 0) {
+		rpc->fault(c, 500, "Bad argument. Select: ALL, HOT or WARM");
+		exit;
+	}
 	
 	
 	print_tree( 0 );
@@ -178,7 +184,7 @@ static void pike_top(rpc_t *rpc, void *c)
 
 // TODO check documentation
 static const char* pike_top_doc[] = {
-	"pike.top doc.",  /* Documentation string */
+	"pike.top Dump parts of the pike table",  /* Documentation string */
 	0                 /* Method signature(s) */
 };