nocost=50000000;
ndownload=0;
squid24=false;
+ dfrom=0;
+ duntil=0;
bzero(IncludeUsers, sizeof(IncludeUsers));
bzero(ExcludeString, sizeof(ExcludeString));
case 'd':
strncpy(date,optarg,sizeof(date)-1);
date[sizeof(date)-1]='\0';
- getword_start(&gwarea,optarg);
- if (getword(cdfrom,sizeof(cdfrom),&gwarea,'-')<0 || getword(cduntil,sizeof(cduntil),&gwarea,'\0')<0) {
- printf(_("SARG: The date range requested on the command line by option -d is invalid.\n"));
- exit(EXIT_FAILURE);
- }
- date_from(date, cdfrom, cduntil);
- dfrom=atoi(cdfrom);
- duntil=atoi(cduntil);
+ date_from(date, &dfrom, &duntil);
break;
case 'e':
strcpy(email,optarg);
}
}
+ if (debug)
+ debuga(_(" Records read: %ld, written: %ld, excluded: %ld\n"),totregsl,totregsg,totregsx);
+
longline_destroy(&line);
if ( fp_Download_Unsort )
fclose (fp_Download_Unsort);
free(ufile);
}
- if (getperiod_buildtext(&period)<0) {
- debuga(_("Failed to build the string representation of the date range\n"));
- exit(EXIT_FAILURE);
- }
-
free_download();
free_excludecodes();
free_exclude();
for (ilf=0 ; ilf<ILF_Last ; ilf++) totalcount+=ilf_count[ilf];
- debuga(_(" Records read: %ld, written: %ld, excluded: %ld\n"),totregsl,totregsg,totregsx);
-
if(ilf_count[ILF_Common]>0 && ilf_count[ILF_Squid]>0)
debuga(_("Log with mixed records format (squid and common log)\n"));
if(ilf_count[ILF_Sarg]>0)
debuga(_("Sarg log format\n"));
- if(totalcount==0) {
- if(!totregsg) {
- debuga(_("No records found\n"));
- debuga(_("End\n"));
- } else debuga(_("Log with invalid format\n"));
- if(fp_denied)
- fclose(fp_denied);
- if(fp_authfail)
- fclose(fp_authfail);
- userinfo_free();
- if(userfile)
- free(userfile);
- close_usertab();
- unlink(denied_unsort);
- unlink(authfail_unsort);
- unlink(tmp3);
- exit(EXIT_SUCCESS);
- }
+ if(totalcount==0 && totregsg)
+ debuga(_("Log with invalid format\n"));
}
if(!totregsg){
debuga(_("No records found\n"));
debuga(_("End\n"));
-// fclose(fp_ou);
- if(fp_denied)
- fclose(fp_denied);
- if(fp_authfail)
- fclose(fp_authfail);
+ if(fp_denied) fclose(fp_denied);
+ if(fp_authfail) fclose(fp_authfail);
userinfo_free();
- if(userfile)
- free(userfile);
+ if(userfile) free(userfile);
close_usertab();
exit(EXIT_SUCCESS);
}
+ if (date[0]!='\0') {
+ char date0[30], date1[30];
+
+ strftime(date0,sizeof(date0),"%d/%m/%Y",&period.start);
+ strftime(date1,sizeof(date1),"%d/%m/%Y",&period.end);
+ debuga(_("Period covered by log files: %s-%s\n"),date0,date1);
+ getperiod_fromrange(&period,dfrom,duntil);
+ }
+ if (getperiod_buildtext(&period)<0) {
+ debuga(_("Failed to build the string representation of the date range\n"));
+ exit(EXIT_FAILURE);
+ }
+
if(debugz){
debugaz("data",dia);
debugaz("period",period.text);