Module: sip-router
Branch: master
Commit: b6e2034d84dcb77bfda256af0de0c434cc83dbb7
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b6e2034d84dcb77bfda256af0de0c434cc83dbb7

Author: Olle E. Johansson <[email protected]>
Committer: Olle E. Johansson <[email protected]>
Date:   Fri Dec 21 09:05:15 2012 +0100

pike: Add error on bad argument

Reported by Ovidiu Sas on the sr-dev list. Bug ported from modules_s/pike :-)

---

 modules_k/pike/pike_rpc.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules_k/pike/pike_rpc.c b/modules_k/pike/pike_rpc.c
index 373302e..2631064 100644
--- a/modules_k/pike/pike_rpc.c
+++ b/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) */
 };
 


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to