/*
* SARG Squid Analysis Report Generator http://sarg.sourceforge.net
- * 1998, 2012
+ * 1998, 2015
*
* SARG donations:
* please look at http://sarg.sourceforge.net/donations.php
#include "include/conf.h"
#include "include/defs.h"
+#include "include/readlog.h"
//! \c True if the current log is known to be a sarg parsed log.
static bool InSargLog=false;
int Hour;
int Minute;
int Second;
+ char *Ip;
+ char *User;
if (strncmp(Line,"*** SARG Log ***",16)==0) {
if (InvalidFileName) {
- debuga(_("The name of the file is invalid for a sarg log\n"));
+ debuga(__FILE__,__LINE__,_("The name of the file is invalid for a sarg log\n"));
exit(EXIT_FAILURE);
}
getperiod_merge(&period,&SargPeriod);
Entry->EntryTime.tm_isdst=-1;
// the ID of the user
- Entry->User=++Line;
+ Entry->User=User=++Line;
for (UserLen=0 ; *Line && *Line!='\t' ; UserLen++) Line++;
if (*Line!='\t' || UserLen==0) return(RLRC_Unknown);
// get IP address
- Entry->Ip=++Line;
+ Entry->Ip=Ip=++Line;
for (IpLen=0 ; *Line && *Line!='\t' ; IpLen++) Line++;
if (*Line!='\t' || IpLen==0) return(RLRC_Unknown);
// check the entry time
if (mktime(&Entry->EntryTime)==-1) {
- debuga(_("Invalid date or time found in the common log file\n"));
+ debuga(__FILE__,__LINE__,_("Invalid date or time found in the common log file\n"));
return(RLRC_InternalError);
}
// it is safe to alter the line buffer now that we are returning a valid entry
- Entry->Ip[IpLen]='\0';
+ Ip[IpLen]='\0';
Entry->HttpCode[HttpCodeLen]='\0';
Entry->Url[UrlLen]='\0';
- Entry->User[UserLen]='\0';
+ User[UserLen]='\0';
return(RLRC_NoError);
}