]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Merge messages about memory shortage.
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Sun, 26 Apr 2015 12:14:18 +0000 (14:14 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Sun, 26 Apr 2015 12:14:18 +0000 (14:14 +0200)
18 files changed:
authfail.c
convlog.c
datafile.c
denied.c
download.c
email.c
html.c
index.c
readlog.c
realtime.c
redirector.c
report.c
siteuser.c
splitlog.c
topsites.c
topuser.c
url.c
userinfo.c

index f1121ad6c44ad1966e2f57aa548e01d9ea45287a..1d4ccc7073895c8aa04d413999768d2dadbf293c 100644 (file)
@@ -184,7 +184,7 @@ void authfail_report(void)
        fprintf(fp_ou,"<tr><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th></tr>\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE"));
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read file %s\n"),authfail_sort);
+               debuga(_("Not enough memory to read file \"%s\"\n"),authfail_sort);
                exit(EXIT_FAILURE);
        }
 
index f906772d6f60ff114e543629fc0f6898c2da3603..8838733ef28e59979288751c1973db7f2f7d93c4 100644 (file)
--- a/convlog.c
+++ b/convlog.c
@@ -48,7 +48,7 @@ void convlog(const char *arq, char df, int dfrom, int duntil)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the log file %s\n"),arq);
+               debuga(_("Not enough memory to read file \"%s\"\n"),arq);
                exit(EXIT_FAILURE);
        }
 
index 46a9a266c976cc9e152c68abd393c9cf630b5e07..293e245bea73c53ad7cdef6588bb91179cf4a96d 100644 (file)
@@ -97,7 +97,7 @@ void data_file(char *tmp)
                }
 
                if ((line=longline_create())==NULL) {
-                       debuga(_("Not enough memory to read the downloaded files.\n"));
+                       debuga(_("Not enough memory to read file \"%s\"\n"),tmp3);
                        exit(EXIT_FAILURE);
                }
 
index 443d785595a12ba1c321529b454fea23aa565e3a..6f4d78b461c2535ac263dcf526ad824edc645ed9 100644 (file)
--- a/denied.c
+++ b/denied.c
@@ -190,7 +190,7 @@ void gen_denied_report(void)
        fprintf(fp_ou,"<tr><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th></tr>\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE"));
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the denied accesses\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),denied_sort);
                exit(EXIT_FAILURE);
        }
 
index 69bc443e68ee1a1ca9ff57f186b43854831efc30..41afaedd9d6375146cb30228032475f4f17faabf 100644 (file)
@@ -225,7 +225,7 @@ void download_report(void)
        fprintf(fp_ou,"<tr><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th></tr>\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE"));
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the downloaded files\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),report_in);
                exit(EXIT_FAILURE);
        }
 
diff --git a/email.c b/email.c
index c0be2f429ba63ede916da882cba7900d18831c8d..5a52aa9082d49407e6eeb07bbf092838fb2a22ab 100644 (file)
--- a/email.c
+++ b/email.c
@@ -72,7 +72,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
        totuser=0;
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read file %s\n"),wger);
+               debuga(_("Not enough memory to read file \"%s\"\n"),wger);
                exit(EXIT_FAILURE);
        }
 
diff --git a/html.c b/html.c
index 113742f9d1c1d0eaa0368061563f517a6237236e..087d807ab3a8387afb4a3d4cc76f339510eb7c38 100644 (file)
--- a/html.c
+++ b/html.c
@@ -167,7 +167,7 @@ void htmlrel(void)
                        have_denied_report=true;
 
                if ((line=longline_create())==NULL) {
-                       debuga(_("Not enough memory to read file %s\n"),arqin);
+                       debuga(_("Not enough memory to read file \"%s\"\n"),arqin);
                        exit(EXIT_FAILURE);
                }
 
@@ -392,7 +392,7 @@ void htmlrel(void)
                                }
 
                                if ((line1=longline_create())==NULL) {
-                                       debuga(_("Not enough memory to read file %s\n"),arqip);
+                                       debuga(_("Not enough memory to read file \"%s\"\n"),arqip);
                                        exit(EXIT_FAILURE);
                                }
                                while((buf=longline_read(fp_ip,line1))!=NULL) {
@@ -459,7 +459,7 @@ void htmlrel(void)
                                olduserip[0]='\0';
 
                                if ((line1=longline_create())==NULL) {
-                                       debuga(_("Not enough memory to read file %s\n"),arqip);
+                                       debuga(_("Not enough memory to read file \"%s\"\n"),arqip);
                                        exit(EXIT_FAILURE);
                                }
                                while((buf=longline_read(fp_ip,line1))!=NULL) {
diff --git a/index.c b/index.c
index 3075b1aee466b30a81a7be0835c47cd48453f889..297581317978ca638dc8fcec45dadc224018bb95 100644 (file)
--- a/index.c
+++ b/index.c
@@ -179,7 +179,7 @@ static long long int get_size(char *path,int path_size)
                                dir_allocated+=size;
                                dir_list=realloc(dir_list,dir_allocated);
                                if (!dir_list) {
-                                       debuga(_("Not enough memory to recurse into subdirectory\n"));
+                                       debuga(_("Not enough memory to recurse into subdirectory \"%s\"\n"),path);
                                        exit(EXIT_FAILURE);
                                }
                        }
index 41c15fe9047e8ef14522155ac466a54e9c4900b1..f71da4ac2a1393ed04574a479baca56a85ffd1d7 100644 (file)
--- a/readlog.c
+++ b/readlog.c
@@ -334,7 +334,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read log file %s\n"),arq);
+               debuga(_("Not enough memory to read file \"%s\"\n"),arq);
                exit(EXIT_FAILURE);
        }
 
index 975d71e01424344baec5024781ea478c387380d5..a8d2019010f173bbd08123a63cdde5769260b4ca 100644 (file)
@@ -187,11 +187,6 @@ void realtime(void)
        init_usertab(UserTabFile);
        LogLine_Init(&log_line);
 
-       if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the log file\n"));
-               exit(EXIT_FAILURE);
-       }
-
        /*
         * Store one more entry to prepare the memory structure in place and reject it if
         * it is about the same user and url as the last stored one.
@@ -218,6 +213,12 @@ void realtime(void)
                debuga(_("Cannot open file \"%s\": %s\n"),file_name,strerror(errno));
                exit(EXIT_FAILURE);
        }
+
+       if ((line=longline_create())==NULL) {
+               debuga(_("Not enough memory to read file \"%s\"\n"),file_name);
+               exit(EXIT_FAILURE);
+       }
+
        while((buf=longline_read(fp,line)) != NULL )
        {
                log_entry_status=LogLine_Parse(&log_line,&log_entry,buf);
index f7ffbe64c42660827761c1e547981792bc3ba9bb..534961ea1809d022765555dc60e1530593bf84ea 100644 (file)
@@ -270,7 +270,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the redirector log\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),wentp);
                exit(EXIT_FAILURE);
        }
 
@@ -475,7 +475,7 @@ void redirector_report(void)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the processed redirector log\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),redirector_sorted);
                exit(EXIT_FAILURE);
        }
 
index be5492468177dae8a2533185a84c0ffde2fe6333..8636e8788757dbcc829ef21eed93889ebb0adeaa 100644 (file)
--- a/report.c
+++ b/report.c
@@ -163,7 +163,7 @@ void gerarel(void)
                oucache=0;
 
                if ((line=longline_create())==NULL) {
-                       debuga(_("Not enough memory to read the downloaded files\n"));
+                       debuga(_("Not enough memory to read file \"%s\"\n"),tmp3);
                        exit(EXIT_FAILURE);
                }
 
index 653fe58791bb7db6ddf9bd822508e6dffe89505e..cf0a073b5b9ffaa3026db1b9ad4544e14a9aa3f2 100644 (file)
@@ -109,7 +109,7 @@ void siteuser(void)
        topuser_link=((ReportType & REPORT_TYPE_USERS_SITES) != 0 && !indexonly);
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read file %s\n"),general2);
+               debuga(_("Not enough memory to read file \"%s\"\n"),general2);
                exit(EXIT_FAILURE);
        }
 
index 2273603f1b6a28c62e71222d12bca2a2f7be2b61..0e153dc7bb440fabdfafb314bddd92f37eb8f3ec 100644 (file)
@@ -85,7 +85,7 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the log file %s\n"),arq);
+               debuga(_("Not enough memory to read file \"%s\"\n"),arq);
                exit(EXIT_FAILURE);
        }
        time(&min_tt);
index e161cc054324458bd392ab38b6e3a197a3b2e30f..7573dfe04082c206861173f17fca8a9df4c3c01d 100644 (file)
@@ -105,7 +105,7 @@ void topsites(void)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read file %s\n"),general2);
+               debuga(_("Not enough memory to read file \"%s\"\n"),general2);
                exit(EXIT_FAILURE);
        }
 
@@ -269,7 +269,7 @@ void topsites(void)
        ntopsites = 0;
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read file %s\n"),sites);
+               debuga(_("Not enough memory to read file \"%s\"\n"),sites);
                exit(EXIT_FAILURE);
        }
 
index 47662cc3d741febf1b34a0cf37400cccc4229830..68858c4ff8ba9d1009a5777df51ad52b38a3fa45 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -103,7 +103,7 @@ void topuser(void)
        totuser=0;
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the file %s\n"),wger);
+               debuga(_("Not enough memory to read file \"%s\"\n"),wger);
                exit(EXIT_FAILURE);
        }
 
@@ -309,7 +309,7 @@ void topuser(void)
        ntopuser = 0;
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the downloaded files\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),top1);
                exit(EXIT_FAILURE);
        }
 
diff --git a/url.c b/url.c
index ac4c1cd7acddfaadfcf9b79dd5331c81870c81a7..5c20132377688efe7a7ee8f0de26c0d870952b13 100644 (file)
--- a/url.c
+++ b/url.c
@@ -586,7 +586,7 @@ void read_hostalias(const char *Filename)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the host name aliases\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),Filename);
                exit(EXIT_FAILURE);
        }
 
index 54859c1b14d40ece38ff8c05517f4efd8093b343..7a3e2cdc3a926259059260c3b120da5882103940 100644 (file)
@@ -330,7 +330,7 @@ void read_useralias(const char *Filename)
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the user name aliases\n"));
+               debuga(_("Not enough memory to read file \"%s\"\n"),Filename);
                exit(EXIT_FAILURE);
        }