static void maketmp(const char *user, const char *dirname, int debug, int indexonly);
static void maketmp_hour(const char *user, const char *dirname, int indexonly);
static void gravatmp_hora(const char *dirname, const struct userinfostruct *uinfo, const char *data, const char *hora, long long int elap, long long int accbytes, int indexonly);
-static void gravatmpf(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache);
+static void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache);
static void gravaporuser(const struct userinfostruct *uinfo, const char *dirname, const char *url, const char *ip, const char *data, const char *hora, long long int tam, long long int elap, int indexonly);
static void gravager(FILE *fp_gen, const struct userinfostruct *uinfo, long long int nacc, const char *url, long long int nbytes, const char *ip, const char *hora, const char *dia, long long int nelap, long long int incache, long long int oucache);
static void grava_SmartFilter(const char *dirname, const char *user, const char *ip, const char *data, const char *hora, const char *url, const char *smart);
strcpy(oldmsg,"DENIED");
else
strcpy(oldmsg,"OK");
- gravatmpf(puinfo,oldurl,nacc,nbytes,oldmsg,nelap,indexonly,incache,oucache);
+ gravatmp(puinfo,oldurl,nacc,nbytes,oldmsg,nelap,indexonly,incache,oucache);
gravager(fp_gen,puinfo,nacc,oldurl,nbytes,oldaccip,oldacchora,oldaccdia,nelap,incache,oucache);
free(oldurl);
}
}
-void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
+static void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
{
FILE *fp_ou;
char wdirname[MAXLEN];
*/
fprintf(fp_ou,"%"PRIu64"\t%"PRIu64"\t%s\t%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",(uint64_t)nacc,(uint64_t)nbytes,oldurl,oldmsg,(uint64_t)nelap,(uint64_t)incache,(uint64_t)oucache);
- fclose(fp_ou);
- ttopen=0;
-
- if(fp_tt) {
- fputs("</table>\n</div>\n",fp_tt);
- fputs("</body>\n</html>\n",fp_tt);
- fclose(fp_tt);
- fp_tt=NULL;
- }
-
- return;
-}
-
-static void gravatmpf(const struct userinfostruct *uinfo,const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
-{
- FILE *fp_ou;
- char wdirname[MAXLEN];
-
- if(indexonly || (ReportType & REPORT_TYPE_USERS_SITES) == 0) return;
-
- if (snprintf(wdirname,sizeof(wdirname),"%s/%s.utmp",tmp,uinfo->filename)>=sizeof(wdirname)) {
- debuga(_("Path too long %s/%s.utmp\n"),tmp,uinfo->filename);
- exit(EXIT_FAILURE);
- }
-
- if((fp_ou=MY_FOPEN(wdirname,"a"))==NULL){
- debuga(_("(report) Cannot open file %s\n"),wdirname);
- exit(EXIT_FAILURE);
- }
-
- /*
- This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
- to print a long long int unless it is exactly 64-bits long.
- */
- fprintf(fp_ou,"%"PRIu64"\t%"PRIu64"\t%s\t%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",(uint64_t)nacc,(uint64_t)nbytes,oldurl,oldmsg,(uint64_t)nelap,(uint64_t)incache,(uint64_t)oucache);
-
if (fclose(fp_ou)==EOF) {
debuga(_("Failed to close file %s - %s\n"),wdirname,strerror(errno));
exit(EXIT_FAILURE);
ttopen=0;
if(fp_tt) {
- fputs("</table>\n",fp_tt);
+ fputs("</table>\n</div>\n",fp_tt);
fputs("</body>\n</html>\n",fp_tt);
fclose(fp_tt);
fp_tt=NULL;
return;
}
-
static void gravatmp_hora(const char *dirname, const struct userinfostruct *uinfo, const char *data, const char *hora, long long int elap, long long int bytes, int indexonly)
{