On Sun, 2003-09-14 at 22:27, Tomasz Kojm wrote:
> > I'd like to redo libclamav to work on memory buffers (using mmap() where
> > possible). At least on the platforms I worked on, Linux and Solaris,
> > this is a very fast alternative to unbuffered stdio.
>
> This is generally a good idea, but I'm not sure all the archive libraries
> in libclamav will support it. The current model is very transparent and
> the changes shouldn't brake it.
I have a feeling that (recursive) archieve processing should be a
separate library, I mean, separate from scanning for viruses. The API
could be like this:
process_archieve(char *arch, size_t asize, int recurse_depth,
int(*scan_buffer)(char *buf, size_t size, void *priv),
void *priv);
scan_buffer would be called on every indivilual archieve member mmaped()
into RAM (or better just unpacked into RAM).
What do you think?
Right now, in zmscanner (http://www.average.org/zmscanner/) I do not
process archieves at all, to avoid dealing with possible resource
overuse due to "mailbombs" and suspected memory leaks, but I would like
to, if there is sane API... BTW there should be some "resource
consumption limiting" features in the archieve processing library...
> > 2. Switch from PThreads to fork()/exec() [I can already hear you! :-)].
> > It is no news that the current code leaks memory and is missing cleanup
> > handlers at thread exit. With the current code layout, I'd say it would
> > be easier to switch to fork than do the cleanup stuff properly.
>
> It will be better to add the "UseProcesses" option to clamd instead of
> removing the thread code. If you disable ScanMail and ScanArchive (which
> is a good idea when using something like amavisd-new) clamd is really fast,
> expecially on SMP.
Alternatively, using processes vs. threads could be a "./configure" time
option.
--
Eugene Crosser, head of Internet Applications section, +7 501 787 1000
ROL, EDN Sovintel, Golden Telecom, http://user.rol.ru/~crosser/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Clamav-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-devel