]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Fix the reporting of downloaded files
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 30 May 2013 19:36:10 +0000 (21:36 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 30 May 2013 19:36:10 +0000 (21:36 +0200)
The reporting of downloaded files was in fact reporting the denied accesses
since a previous changes in version 2.4.

download.c
readlog.c

index 1bf745d17d8696eb79b305d9d9d1c2e13e92a427..e8f11bf52636966272fe4cc5558eae377f340a95 100644 (file)
@@ -87,7 +87,7 @@ void download_write(const struct ReadLogStruct *log_entry,const char *url)
 {
        char date[80];
 
-       if (fp_download && strstr(log_entry->HttpCode,"DENIED") != 0) {
+       if (fp_download && strstr(log_entry->HttpCode,"DENIED") == 0) {
                strftime(date,sizeof(date),"%d/%m/%Y\t%H:%M:%S",&log_entry->EntryTime);
                fprintf(fp_download,"%s\t%s\t%s\t%s\n",date,log_entry->User,log_entry->Ip,url);
                download_exists=true;
index d3930255001017edd990cdc4f5d8c160fa40d8f6..75bf81bdab0496e28dc05af10adc5f35129e0310 100644 (file)
--- a/readlog.c
+++ b/readlog.c
@@ -623,7 +623,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
 
                denied_write(&log_entry);
                authfail_write(&log_entry);
-               download_write(&log_entry,download_url);
+               if (download_flag) download_write(&log_entry,download_url);
 
                if (current_format!=&ReadSargLog) {
                        if (period.start.tm_year==0 || idata<mindate || compare_date(&period.start,&log_entry.EntryTime)>0){