]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Keep only UserIp at the global scope and remove global userip
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 12 Apr 2010 13:25:21 +0000 (13:25 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 12 Apr 2010 13:25:21 +0000 (13:25 +0000)
include/conf.h
log.c
realtime.c

index d47b987b1bf653c16fa992f5b80bdbc403ca23bc..d15c235846a3372f5e9a00df9f56fd609f9e740e 100755 (executable)
@@ -411,7 +411,6 @@ int  duntil;
 int  dataonly;
 int  indexonly;
 bool  iprel;
-bool  userip;
 int  langcode;
 int  debug;
 int  debugz;
diff --git a/log.c b/log.c
index fa75c4bbda70e0cba42b10632cb683ffcac796e8..fc62647637500fc2d70469f4214fdd7c2a071b2d 100644 (file)
--- a/log.c
+++ b/log.c
@@ -131,7 +131,7 @@ int main(int argc,char *argv[])
    int blen;
    int maxopenfiles;
    int nopen;
-   int id_is_ip;
+   bool id_is_ip;
    long totregsl=0;
    long totregsg=0;
    long totregsx=0;
@@ -139,6 +139,7 @@ int main(int argc,char *argv[])
    long int max_elapsed=0;
    long long int iyear, imonth, iday;
    bool realt;
+   bool userip;
    struct tm tt;
    struct tm *t;
    unsigned long recs1=0UL;
@@ -205,7 +206,7 @@ int main(int argc,char *argv[])
    strcpy(FontSize,"9px");
    strcpy(TempDir,"/tmp");
    strcpy(OutputDir,"/var/www/html/squid-reports");
-   Ip2Name=0;
+   Ip2Name=false;
    strcpy(DateFormat,"u");
    OverwriteReport=false;
    RemoveTempFiles=true;
@@ -487,7 +488,7 @@ int main(int argc,char *argv[])
    if(access(ConfigFile, R_OK) == 0)
       getconf();
 
-   if(UserIp) userip=true;
+   if(userip) UserIp=true;
 
    if(dns) Ip2Name=true;
 
@@ -1305,15 +1306,15 @@ int main(int argc,char *argv[])
             if(strstr(url,site)==0) continue;
          }
 
-         if(userip) {
+         if(UserIp) {
             strcpy(user,ip);
-            id_is_ip=1;
+            id_is_ip=true;
          } else {
-            id_is_ip=0;
+            id_is_ip=false;
             if(strcmp(user,"-") == 0 || strcmp(user," ") == 0 || strcmp(user,"") == 0) {
                if(RecordsWithoutUser == RECORDWITHOUTUSER_IP) {
                   strcpy(user,ip);
-                  id_is_ip=1;
+                  id_is_ip=true;
                }
                if(RecordsWithoutUser == RECORDWITHOUTUSER_IGNORE)
                   continue;
index 0fa8439739fe93e0972c8ce1607eabbdf1dda881..4fdc25e1489310f9ac41c8641acd32147555d82e 100755 (executable)
@@ -239,7 +239,7 @@ static void datashow(const char *tmp)
       if(strcmp(ouser,user) == 0 && ourl && strcmp(ourl,url) == 0)
          continue;
 
-      if(userip)
+      if(UserIp)
          strcpy(user,ip);
       strcpy(u2,user);
       if(Ip2Name)