int iarq=0;
int isa_ncols=0,isa_cols[ISACOL_Last];
int lastlog=-1;
+ long int nbytes;
+ long int elap_time;
bool from_stdin;
bool from_pipe;
int blen;
if(strcmp(user,"-") ==0 || strcmp(user," ") ==0 || strcmp(user,"") ==0 || strcmp(user,":") ==0)
continue;
+ nbytes=atol(tam);
+ if (nbytes<0) nbytes=0;
+
+ elap_time=atol(elap);
+ if (elap_time<0) elap_time=0;
if(max_elapsed) {
- if(atol(elap)>max_elapsed) {
- elap[0]='0';
- elap[1]='\0';
+ if(elap_time>max_elapsed) {
+ elap_time=0;
}
}
first_user_file=ufile;
}
}
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ ufile->user->nbytes+=nbytes;
+ ufile->user->elap+=elap_time;
+#endif
if (ufile->file==NULL) {
if (nopen>=maxopenfiles) {
}
strcpy( sz_Last_User , user ) ;
}*/
- if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",dia,hora,ip,url,tam,code,elap,smartfilter)<=0) {
+ if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%ld\t%s\t%ld\t%s\n",dia,hora,ip,url,nbytes,code,elap_time,smartfilter)<=0) {
debuga(_("Write error in the log file of user %s\n"),user);
exit(EXIT_FAILURE);
}
if(fp_log && ilf!=ILF_Sarg)
- fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,url,tam,code,elap,smartfilter);
+ fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%ld\t%s\t%ld\t%s\n",dia,hora,user,ip,url,nbytes,code,elap_time,smartfilter);
totregsg++;
if(debugm){
printf("IP=\t%s\n",ip);
printf("USER=\t%s\n",user);
- printf("ELAP=\t%s\n",elap);
+ printf("ELAP=\t%ld\n",elap_time);
printf("DATE=\t%s\n",dia);
printf("TIME=\t%s\n",hora);
printf("FUNC=\t%s\n",fun);
printf("URL=\t%s\n",url);
printf("CODE=\t%s\n",code);
- printf("LEN=\t%s\n",tam);
+ printf("LEN=\t%ld\n",nbytes);
}
}
if (!from_stdin) {
}
fprintf(fp_ou, "<td class=\"header_r\">%s</td></tr>\n",fixnum(tt,1));
fputs("</table>\n",fp_ou);
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ if (tt!=uinfo->nbytes) {
+ debuga(_("Total downloaded bytes is %"PRIi64" instead of %"PRIi64" in the hourly report of user %s\n"),
+ (int64_t)tt,(int64_t)uinfo->nbytes,uinfo->label);
+ exit(EXIT_FAILURE);
+ }
+#endif
}
if((datetimeby & DATETIME_ELAP)!=0) {
}
fprintf(fp_ou, "<td class=\"header_r\">%s</td></tr>\n",fixtime(tt));
fputs("</table>\n",fp_ou);
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ if (tt!=uinfo->elap) {
+ debuga(_("Total elapsed time is %"PRIi64" instead of %"PRIi64" in the hourly report of user %s\n"),
+ (int64_t)tt,(int64_t)uinfo->elap,uinfo->label);
+ exit(EXIT_FAILURE);
+ }
+#endif
}
if (write_html_trailer(fp_ou)<0)