Commit graph

86 commits

Author SHA1 Message Date
Török Edvin
39b84970e1 new clamd command: nVERSIONCOMMANDS (bb #1437).
git-svn: trunk@4922
2009-03-10 17:51:06 +00:00
Török Edvin
3dc90d4a30 stop scanning when client disconnects in multiscan mode (bb #1417).
git-svn: trunk@4847
2009-02-23 12:35:40 +00:00
Török Edvin
31d5b62ceb real fix for BB #1403.
git-svn: trunk@4829
2009-02-18 19:26:30 +00:00
Török Edvin
a414efbf5e revert previous commit, it is the wrong fix.
git-svn: trunk@4828
2009-02-18 19:11:21 +00:00
Török Edvin
a1f0c01189 Fix wrong use of strerror_r: it doesn't have to use/fill the buffer,
it can return a pointer to a static location, as described in the manpage.
This can happen on a Linux system with a foreign locale, where the LANG=C messages are
returned this way. (BB #1403)

git-svn: trunk@4827
2009-02-18 19:08:15 +00:00
Török Edvin
537292a773 Reject new commands sent as new-style commands to avoid confusion.
This means that IDSESSION/INSTREAM must be sent as nIDSESSION\n or zIDSESSION\0,
ditto for INSTREAM.
Adjust testcases accordingly.
Old commands are still accepted when sent without delimiter.

git-svn: trunk@4811
2009-02-17 18:04:48 +00:00
Török Edvin
fb6fe4f5d1 Introduce '$' in logg, it is active when logg_verbose=2, i.e. when Debug yes.
Fix leak reported by valgrind.

git-svn: trunk@4806
2009-02-17 15:59:36 +00:00
Török Edvin
0378a9ab77 introduce timeouts for send(), this is needed for IDSESSION to work reliably,
since a buggy client implementation may get stuck in send(), and then clamd
gets stuck in send() -> deadlock. To avoid this we need nonblocking sockets, and
(low) timeouts on send.
Add more tests for clamd protocol, including a stress test for IDSESSION.

git-svn: trunk@4798
2009-02-16 18:27:08 +00:00
Török Edvin
4e24a36173 add more unit tests.
Make handling of old-style commands compatible with old clamd: if they have a \n
that will delimit the command.
If multiscan of a single file encounters errors, don't reply OK too.

git-svn: trunk@4796
2009-02-16 18:26:58 +00:00
Török Edvin
b3b8212f7f make clamdtop use IDSESSION, and enable VERSION/STATS inside IDSESSION.
git-svn: trunk@4789
2009-02-14 16:13:38 +00:00
Tomasz Kojm
086eab5c26 update old copyright headers
git-svn: trunk@4775
2009-02-13 10:55:45 +00:00
Török Edvin
034994bd9c fdpassing is now in others.c instead of session.c, move
the defines.

git-svn: trunk@4774
2009-02-13 08:41:59 +00:00
Török Edvin
9ac109f338 add missing include
git-svn: trunk@4773
2009-02-13 08:01:12 +00:00
Török Edvin
949c6fe54f merge from clamd-proto branch:
handle multiple %v parameters
    introduce poll_fds that also does the read into a buffer
    introduce thrmgr_group* commands for keeping track of groups of commands
    (multiscan, IDSESSION)
    introduce 2 queues in thrmgr, multiscan queues get lower priority. Commands
    are processed from both queues in a 4:1 ratio to avoid starvation.
    unify reply code: conn_reply*
    unify scanner code into scan_callback that is called from cli_ftw
    multiscan doesn't need stat() now if readdir() provides dt_type
    redesign clamd main loop: there is now an accept thread, and a
    recv()/dispatch thread, +MaxThreads worker (scanner) threads.
    introduce limiting on commands when worker threads are contended.
    introduce IDSESSION, a replacement for the old SESSION command, that allows
    asyncronous (scan) commands and scan replies
    introduce INSTREAM that allows sending the data to scan on same connection
    (vs STREAM that requires another port)
    introduce zCOMMANDS

git-svn: trunk@4755
2009-02-12 16:51:09 +00:00
Tomasz Kojm
064b4a0c99 initial version of the unified option parser (bb#1215)
git-svn: trunk@4565
2008-12-17 21:42:54 +00:00
Tomasz Kojm
370892d044 clamscan, clamd: use the new API; drop the hardcoded default limits and use the ones set in cl_engine_new()
git-svn-id: file:///var/lib/svn/clamav-devel/branches/newapi@4384 77e5149b-7576-45b1-b177-96237e5ba77b
2008-11-12 16:19:43 +00:00
Török Edvin
b9b477842d fix compiler warnings, more to come (bb #273)
git-svn: trunk@4346
2008-11-06 14:27:43 +00:00
Török Edvin
deb3031222 mempool statistics support
git-svn: trunk@4344
2008-11-06 14:27:27 +00:00
Tomasz Kojm
ac1b219cf1 libclamav, clamd: always return correct db version in VERSION (bb#1168)
git-svn: trunk@4332
2008-11-04 18:45:48 +00:00
Török Edvin
ee7ac1fc63 fix mixed statements (bb #1269)
git-svn: trunk@4326
2008-11-04 08:58:51 +00:00
Török Edvin
aa22174b30 new command STATS
new top-like tool using ncurses: clamdtop

it shows what clamd is currently scanning (and since how long),
including which file(s) multiscan is working on currently,
how many items it has in the queue (and since how long they are waiting),
how many active/idle threads it has,
memory usage statistics,
can monitor local or remote clamd

git-svn: trunk@4324
2008-11-03 19:27:20 +00:00
Török Edvin
7959343dc7 allow make distcheck to succeed (bb #1142)
fix some more warnings
  filter -Werror in clamav-milter.c

git-svn: trunk@4141
2008-08-25 14:18:48 +00:00
Török Edvin
add738d28c portability fixes
if there is a version.h.static use that instead of output from svnversion
use get_version(), tools outside libclamav shouldn't rely on libclamav version
exception: clamconf itself needs both, and the milter shows both

git-svn: trunk@4076
2008-08-04 10:38:24 +00:00
Török Edvin
04f9bedf4b use SVN revision in version info
TODO: replace every remaining use of VERSION with cl_retver()

git-svn: trunk@4070
2008-08-03 21:52:11 +00:00
Török Edvin
cb4e478c1a remove duplicate code, and fix build error (bb #1034)
git-svn: trunk@3859
2008-05-24 19:27:48 +00:00
Török Edvin
ad4ae516c8 fix dummy prototype (bb #1019)
git-svn: trunk@3850
2008-05-11 07:55:01 +00:00
Török Edvin
725a296922 build system: add configure checks for FD passing
m4/fdpassing.m4: move all FD passing checks here
clamd/session.[ch], scanner.[ch]:
contrib/clamd_fdscan:
	add rfc2292/bsd4.4 style file descriptor passing support
	this code is from Marc Balmer <marc*msys.ch>, with some portability
	fixes applied


git-svn: trunk@3849
2008-05-09 21:12:28 +00:00
Tomasz Kojm
6f6fc585f5 bb#907
git-svn: trunk@3752
2008-04-02 21:40:00 +00:00
Török Edvin
9e751804a2 introduce cli_ctime() that uses ctime_r() when
available, and falls back to locking with a mutex around
		ctime(). (ensures we are using the same mutex always).
use cli_ctime() instead of the thread-unsafe ctime().
		This fixes stability problems.


git-svn: trunk@3578
2008-02-03 19:23:20 +00:00
Tomasz Kojm
df599e74f9 drop support for direct fd passing (not maintained)
git-svn: trunk@3520
2008-01-22 08:38:24 +00:00
Tomasz Kojm
cb9d09c2a3 add support for .cld files (bb#745)
git-svn: trunk@3480
2008-01-03 12:10:53 +00:00
Tomasz Kojm
bb34cb31fe update some copyrights and stick to GPL v2
git-svn: trunk@3003
2007-03-31 20:31:04 +00:00
Tomasz Kojm
8ca8a18e2d drop shared/memory.[ch]
git-svn: trunk@2874
2007-02-28 02:44:23 +00:00
Tomasz Kojm
1a4994e304 fix compilation error on Solaris (bb#341)
git-svn: trunk@2850
2007-02-23 19:15:28 +00:00
Tomasz Kojm
a617b5ea1c merge multiscan() with dirscan() (also closes bb#302)
git-svn: trunk@2821
2007-02-20 21:19:04 +00:00
Sven Strickroth
a99111f050 remove old CVS-stuff and make the repository look more like SVN
git-svn: trunk@2755
2007-02-17 19:02:20 +00:00
Renamed from clamav-devel/clamd/session.c (Browse further)