Re: [Clamav-users] LibclamAV - Very Slow

2006-09-27 Thread tBB
>>My application is called every time, a mail arrives.
> 
> ...And every time you load the signature databases, I guess...

What he probably means is that you should use ClamD/ClamDScan instead of
ClamScan.

Best regards

Nico

-- 
+--+

 Q: Because it reverses the logical flow of conversation.
 A: Why is putting a reply at the top of the message frowned upon?
___
http://lurker.clamav.net/list/clamav-users.html


RE: [Clamav-users] LibclamAV - Very Slow

2006-09-27 Thread Alexander Hagenah
[EMAIL PROTECTED] <> schrieb am :

> On 2006-09-27 14:27, Alexander Hagenah wrote:
>> But they are as different speedy, I never expected.
> 
> You're loading and unpacking the virus database each time.
> You see the same difference between "clamscan" and "clamdscan".

I see and found the fault in my code.
But, can't I change it like I the signatures/database is loaded once
into memory and after, I just call this instead?

-- 

Mit freundlichem Gruss

Alexander Hagenah
Technik

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany


Damit wir Ihnen bestmöglichen Service bieten können, senden
Sie Ihre E-Mail-Anfragen bitte an [EMAIL PROTECTED]


http://www.topconcepts.deTel. +49 1805 9977 501*
E-Mail: [EMAIL PROTECTED]   Fax. +49 1805 9977 502*

Handelsregister: AG Tostedt HRB 100687 - UstId: DE 213645563

*) EUR 0,12/Min. (CNS24)

___
http://lurker.clamav.net/list/clamav-users.html


Re: [Clamav-users] LibclamAV - Very Slow

2006-09-27 Thread tBB
>>>My application is called every time, a mail arrives.
>> 
>> ...And every time you load the signature databases, I guess...

> What he probably means is that you should use ClamD/ClamDScan instead of
> ClamScan.

Sorry, I brain-farted. What I probably meant is that you should use
ClamD if possible and connect directly to it instead of using libclamav.

Best regards, Nico

-- 
+--+

 Q: Because it reverses the logical flow of conversation.
 A: Why is putting a reply at the top of the message frowned upon?

___
http://lurker.clamav.net/list/clamav-users.html


Re: [Clamav-users] LibclamAV - Very Slow

2006-09-27 Thread Paul Bijnens

On 2006-09-27 14:27, Alexander Hagenah wrote:

But they are as different speedy, I never expected.


You're loading and unpacking the virus database each time.
You see the same difference between "clamscan" and "clamdscan".


--
Paul Bijnens, xplanation Technology ServicesTel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUMFax  +32 16 397.512
http://www.xplanation.com/  email:  [EMAIL PROTECTED]
***
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, ^^, *
* F6, quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* init 0, kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out  *
***

___
http://lurker.clamav.net/list/clamav-users.html


Re: [Clamav-users] LibclamAV - Very Slow

2006-09-27 Thread Webmaster
Hi,

Le Mercredi 27 Septembre 2006 14:27, Alexander Hagenah a écrit :

> My application is called every time, a mail arrives.
...And every time you load the signature databases, I guess...

Cordialement,

Arnaud Jacques
Consultant Sécurité

Téléphone / Fax : +33-(0)3.44.39.76.46
Portable : +33-(0)6.24.40.95.03
E-mail : [EMAIL PROTECTED]

Securiteinfo.com
La Sécurité Informatique - La Sécurité des Informations.
266, rue de Villers
60123 Bonneuil en Valois
___
___
http://lurker.clamav.net/list/clamav-users.html


[Clamav-users] LibclamAV - Very Slow

2006-09-27 Thread Alexander Hagenah
Howdy,

I'm using my XMail [1] and have 2 virus-scanner implemented into an own
tool, which is working between MTA and the virus-scanners.
There, I am using BitDefender API and ClamAV [libclamav].

My application is called every time, a mail arrives.

But they are as different speedy, I never expected.

With LibClamAV-function activated:

.--
| [EMAIL PROTECTED] filter]$ time ./main test_mail
| 
| real0m3.896s
| user0m1.488s
| sys 0m0.135s
`--

With BitDefender-function activated:

.--
| [EMAIL PROTECTED] filter]# time ./main test_mail
| 
| real0m0.012s
| user0m0.004s
| sys 0m0.004s
`--

Extremly difference, eh?
The virus is discovered by both, so everything is working fine with
LibClamAV I think?!

I attach the function. Maybe some of you guys can help me with that
problem.
I cannot expect at all, that LibClamAV is so slow in any case.

[1] http://xmailserver.org

--

With kind regards,
Alexander Hagenah
int vCheckClamAv() {

int ret;
unsigned intsigs = 0;
unsigned long int   blocks = 0;
struct  cl_node *root = NULL;
struct  cl_limits limits;
struct  cl_stat dbstat;

memset(&dbstat, 0, sizeof(struct cl_stat));
cl_statinidir(cl_retdbdir(), &dbstat);

if((cl_loaddbdir(cl_retdbdir(), &root, &sigs))) {
errorHandler(ERRCODE_SMTP_TEMP, ERRSTR_INTERN_CLAMDB);
}

if((ret = cl_build(root))) {
syslog(LOG_NOTICE, "Database initialization error: %s\n", 
cl_strerror(ret));
cl_free(root);
close(clam_fd); 
}   

clam_fd = open(mailFileName, O_RDONLY);

memset(&limits, 0, sizeof(struct cl_limits));

limits.maxfiles = 1000; 
limits.maxfilesize = 10 * 1048576;
limits.maxreclevel = 5;
limits.maxratio = 200;
limits.archivememlim = 0;

if((!cl_scandesc(clam_fd, &clamav_virname, &blocks, root, &limits, 
CL_SCAN_STDOPT)) == CL_VIRUS) {
syslogCav();
vStatus = 1;
}

virName = (char*) clamav_virname;
syslog(LOG_NOTICE, "virus: %s", virName);

return(vStatus);
}
___
http://lurker.clamav.net/list/clamav-users.html