serious bug fixed
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 11 Oct 2012 23:47:17 +0000 (23:47 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 11 Oct 2012 23:47:17 +0000 (23:47 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@205 251d49ef-1d17-4917-a970-b30cf55b089b

cll1-0.6.2.h
htmlandlogs.c
json.c
prometheus.c

index 37a6ab5577819489bf4de80f9273ec02d3e435fd..6b2214bd940c39e0cde0ea63bd66decc91ae9b20 100644 (file)
@@ -35,7 +35,7 @@
 
 #define not !
 #define and &&
-#define or &&
+#define or ||
 #define TRUE 1
 #define FALSE 0
 #define loop while(1)
index 73a3d0f3f682270e99c28213202c77bcfbfd2a2b..98af96c4a3fb22b34208d9e0bd8b5c3c9450beb8 100644 (file)
@@ -50,7 +50,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
 {\r
  int i;\r
  char *str;\r
- FILE *f=fopen(html,"w");\r
+ FILE *f=fopen(html, "w");\r
 \r
  string(str,STRLEN); \r
  if(f > 0)\r
@@ -58,10 +58,6 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
   int count=1;\r
   i=0;\r
 \r
-  /*-----------------------------------------------------------------*/\r
-  printf("Writing statistics summary into HTML page %s ...\n", html);\r
-  /*-----------------------------------------------------------------*/\r
-\r
   if(use_jquery_popups)\r
   {\r
    fprintf(f,"<script type=\"text/javascript\" src=\"%s\"></script>\n", jquery_url);\r
diff --git a/json.c b/json.c
index c9c63f0eb8dd37a4a5a7f4960d1393f156f3db84..0d8b5141e3e248517a34d2a6fe7d85c9cb51bc07 100644 (file)
--- a/json.c
+++ b/json.c
@@ -12,6 +12,7 @@ void write_json_traffic(char *json)
   {\r
    int jsoncount=0;\r
    fprintf(f, "{\n");\r
+\r
    for_each(ip, ips)\r
    {\r
     if(      ip->lmsid > 0 \r
@@ -21,11 +22,12 @@ void write_json_traffic(char *json)
      {\r
       fprintf(f, ",\n");\r
      }\r
-     fprintf(f, " \"%s\":{ \"lms\": %d, \"ip\":\"%s\", \"total\":%Lu, \"down\":%Lu, \"proxy\":%Lu, \"up\":%Lu,\\r
-                  \"min\":%d, \"max\":%d, \"limit\":%d, \"realquota\":%Lu, \"credit\":%Lu, \"dailyquota\":%ld }",\r
-                ip->name, ip->lmsid, ip->addr, ip->traffic, ip->direct, ip->proxy, ip->upload, \r
-                ip->min, ip->desired, ip->max, ip->realquota, ip->credit, \r
-                (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));\r
+     fprintf(f, \r
+             " \"%s\":{ \"lms\": %d, \"ip\":\"%s\", \"total\":%Lu, \"down\":%Lu, \"proxy\":%Lu, \"up\":%Lu, \\r
+\"min\":%d, \"max\":%d, \"limit\":%d, \"realquota\":%Lu, \"credit\":%Lu, \"dailyquota\":%ld }",\r
+             ip->name, ip->lmsid, ip->addr, ip->traffic, ip->direct, ip->proxy, ip->upload, \r
+             ip->min, ip->desired, ip->max, ip->realquota, ip->credit, \r
+             (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));\r
      jsoncount++;\r
     }\r
    }\r
index 2eda2592210dfd88b0e774a7e32278ea6dcde8c3..780b15858c8dadec585d28a63b31ffe8c0350205 100644 (file)
@@ -1086,7 +1086,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
  /*-----------------------------------------------------------------*/\r
  printf("Writing statistics into HTML page %s ...\n", html);\r
  /*-----------------------------------------------------------------*/\r
- write_htmlandlogs(json_traffic,d,total, just_preview);\r
+ write_htmlandlogs(html, d,total, just_preview);\r
 \r
  if(just_preview)\r
  {\r
This page took 0.213686 seconds and 4 git commands to generate.