longline line;
char *linebuf;
char *str;
- char *full_url;
char arq_log[255];
char fun[MAXLEN];
char elap[255];
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq);
exit(EXIT_FAILURE);
}
- if (getword_ptr(linebuf,&full_url,&gwarea,' ')<0) {
+ if (getword_ptr(linebuf,&log_entry.Url,&gwarea,' ')<0) {
debuga(_("Maybe you have a broken url in your %s file\n"),arq);
exit(EXIT_FAILURE);
}
debuga(_("Maybe you have a broken request method in your %s file\n"),arq);
exit(EXIT_FAILURE);
}
- if (getword_ptr(linebuf,&full_url,&gwarea,' ')<0){
+ if (getword_ptr(linebuf,&log_entry.Url,&gwarea,' ')<0){
debuga(_("Maybe you have a broken url in your %s file\n"),arq);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
log_entry.Ip=ip;
- if (getword_ptr(linebuf,&full_url,&gwarea,'\t')<0){
+ if (getword_ptr(linebuf,&log_entry.Url,&gwarea,'\t')<0){
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq);
exit(EXIT_FAILURE);
}
} else if (x==isa_cols[ISACOL_Bytes]) {
log_entry.DataSize=atoll(str);
} else if (x==isa_cols[ISACOL_Uri]) {
- full_url=str;
+ log_entry.Url=str;
} else if (x==isa_cols[ISACOL_Status]) {
if (strlen(str)>=sizeof(code)) {
debuga(_("Maybe you have a broken access code in your %s file\n"),arq);
debuga(_("Unknown input log file format: no user\n"));
break;
}
+ if (log_entry.Url==NULL) {
+ debuga(_("Unknown input log file format: no URL\n"));
+ break;
+ }
if(debugm)
printf("DATE=%s IDATA=%d DFROM=%d DUNTIL=%d\n",Filter->DateRange,idata,dfrom,duntil);
continue;
// replace any tab by a single space
- for (str=full_url ; *str ; str++)
+ for (str=log_entry.Url ; *str ; str++)
if (*str=='\t') *str=' ';
for (str=log_entry.HttpCode ; *str ; str++)
if (*str=='\t') *str=' ';
The full URL is not saved in sarg log. There is no point in testing the URL to detect
a downloaded file.
*/
- download_flag=is_download_suffix(full_url);
+ download_flag=is_download_suffix(log_entry.Url);
if (download_flag) {
- safe_strcpy(download_url,full_url,sizeof(download_url));
+ safe_strcpy(download_url,log_entry.Url,sizeof(download_url));
download_count++;
}
} else
download_flag=false;
- url=process_url(full_url,LongUrl);
+ url=process_url(log_entry.Url,LongUrl);
if (!url || url[0] == '\0') continue;
if(addr[0] != '\0'){
}
if(fp_denied && strstr(log_entry.HttpCode,"DENIED/403") != 0) {
- fprintf(fp_denied, "%s\t%s\t%s\t%s\t%s\n",dia,hora,log_entry.User,log_entry.Ip,full_url);
+ fprintf(fp_denied, "%s\t%s\t%s\t%s\t%s\n",dia,hora,log_entry.User,log_entry.Ip,log_entry.Url);
denied_count++;
}
if((ReportType & REPORT_TYPE_AUTH_FAILURES) != 0) {
if(fp_authfail && (strstr(log_entry.HttpCode,"DENIED/401") != 0 || strstr(log_entry.HttpCode,"DENIED/407") != 0)) {
- fprintf(fp_authfail, "%s\t%s\t%s\t%s\t%s\n",dia,hora,log_entry.User,log_entry.Ip,full_url);
+ fprintf(fp_authfail, "%s\t%s\t%s\t%s\t%s\n",dia,hora,log_entry.User,log_entry.Ip,log_entry.Url);
authfail_count++;
}
}