Speed up scanning of clean files

git-svn: trunk@1956
remotes/push_mirror/metadata
Nigel Horne 20 years ago
parent 1be8b51f10
commit 01c99f5312
  1. 12
      clamav-devel/libclamav/mbox.c
  2. 8
      clamav-devel/libclamav/text.c

@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
static char const rcsid[] = "$Id: mbox.c,v 1.296 2006/05/04 08:34:02 nigelhorne Exp $";
static char const rcsid[] = "$Id: mbox.c,v 1.297 2006/05/04 10:37:02 nigelhorne Exp $";
#if HAVE_CONFIG_H
#include "clamav-config.h"
@ -735,6 +735,8 @@ cli_mbox(const char *dir, int desc, cli_ctx *ctx)
if(datalen < 0)
break;
if(fileblobContainsVirus(fb))
break;
if((b64size > 0) && (*ptr == '\r')) {
b64start = ++ptr;
@ -2797,7 +2799,7 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
inheader = TRUE;
topofbounce = NULL;
for(;;) {
do {
l = t->t_line;
if(l == NULL) {
@ -2822,7 +2824,7 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
break;
}
}
}
} while(!fileblobContainsVirus(fb));
fileblobDestroy(fb);
if(topofbounce)
@ -2913,7 +2915,7 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
if(t && ((fb = fileblobCreate()) != NULL)) {
cli_dbgmsg("Found a bounce message\n");
fileblobSetFilename(fb, dir, "bounce");
fileblobSetCTX(fb, ctx);
/*fileblobSetCTX(fb, ctx);*/
if(textToFileblob(start, fb) == NULL)
cli_dbgmsg("Nothing new to save in the bounce message");
else
@ -2944,11 +2946,11 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
cli_dbgmsg("Found a bounce message with no header at '%s'\n",
lineGetData(t_line->t_line));
fileblobSetFilename(fb, dir, "bounce");
fileblobSetCTX(fb, ctx);
fileblobAddData(fb,
(const unsigned char *)"Received: by clamd (bounce)\n",
28);
/*fileblobSetCTX(fb, ctx);*/
fb = textToFileblob(t_line, fb);
fileblobDestroy(fb);

@ -17,6 +17,9 @@
* MA 02110-1301, USA.
*
* $Log: text.c,v $
* Revision 1.18 2006/05/04 10:37:03 nigelhorne
* Speed up scanning of clean files
*
* Revision 1.17 2006/05/03 09:36:40 nigelhorne
* Pass full ctx into the mbox code
*
@ -61,7 +64,7 @@
*
*/
static char const rcsid[] = "$Id: text.c,v 1.17 2006/05/03 09:36:40 nigelhorne Exp $";
static char const rcsid[] = "$Id: text.c,v 1.18 2006/05/04 10:37:03 nigelhorne Exp $";
#if HAVE_CONFIG_H
#include "clamav-config.h"
@ -267,7 +270,8 @@ textToFileblob(const text *t, fileblob *fb)
if(fb == NULL)
return NULL;
}
} else
fb->ctx = NULL; /* no need to scan */
return textIterate(t, addToFileblob, fb);
}

Loading…
Cancel
Save