json bug fix
[svn/Prometheus-QoS/.git] / prometheus.c
index 8301c0d9c8497ffe5b410a19b33c7301a6522976..e58677c13350faa9af4fe1783fbab7f050fc9cca 100644 (file)
@@ -7,7 +7,7 @@
 /*  Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf  */\r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
 \r
-/* Modified by: xChaos, 20120516\r
+/* Modified by: xChaos, 20120610\r
                  ludva, 20080415\r
  \r
    Prometheus QoS is free software; you can redistribute it and/or\r
@@ -33,7 +33,7 @@
 \r
 #include "cll1-0.6.2.h"\r
 \r
-const char *version = "0.8.3-d";\r
+const char *version = "0.8.3-e";\r
 \r
 /* Version numbers: 0.8.3 is development releases ("beta"), 0.8.4 will be "stable" */\r
 /* Debian(RPM) package versions/patchlevels: 0.7.9-2, 0.8.0-1, 0.8.0-2, etc. */\r
@@ -1653,10 +1653,11 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     {\r
      fprintf(f, ",\n");\r
     }\r
-    if(ip->traffic || ip->direct || ip->proxy || ip->upload)\r
+    if(     ip->lmsid > 0 \r
+        && (ip->traffic || ip->direct || ip->proxy || ip->upload))\r
     {\r
-     fprintf(f, " %d:{ \"ip\":\"%s\", \"total\":%Lu, \"down\":%Lu, \"proxy\":%Lu, \"up\":%Lu }",\r
-                ip->lmsid, ip->addr, ip->traffic, ip->direct, ip->proxy, ip->upload);\r
+     fprintf(f, " \"%s\":{ \"lms\": %d, \"ip\":\"%s\", \"total\":%Lu, \"down\":%Lu, \"proxy\":%Lu, \"up\":%Lu }",\r
+                ip->name, ip->lmsid, ip->addr, ip->traffic, ip->direct, ip->proxy, ip->upload);\r
     }\r
     jsoncount++;\r
    }\r
This page took 0.130463 seconds and 4 git commands to generate.