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 37a6ab5..6b2214b 100644 (file)
@@ -35,7 +35,7 @@
 
 #define not !
 #define and &&
 
 #define not !
 #define and &&
-#define or &&
+#define or ||
 #define TRUE 1
 #define FALSE 0
 #define loop while(1)
 #define TRUE 1
 #define FALSE 0
 #define loop while(1)
index 73a3d0f..98af96c 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
 {\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
 \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
   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
   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 c9c63f0..0d8b514 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
    int jsoncount=0;\r
    fprintf(f, "{\n");\r
+\r
    for_each(ip, ips)\r
    {\r
     if(      ip->lmsid > 0 \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
      {\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
      jsoncount++;\r
     }\r
    }\r
index 2eda259..780b158 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
  /*-----------------------------------------------------------------*/\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
 \r
  if(just_preview)\r
  {\r
This page took 0.224968 seconds and 4 git commands to generate.