Maxim Dounin wrote:
use SESSION->PING->check ping result, issue END on timeout, STREAM on success.

On implementing this I am reminded of the thread in the 'user' list, titled "ClamAV 0.83 - Stream scanning timeout", and the debate about what 'pause' meant. Essentially I have to introduce an artificial delay between the SESSION and PING commands, otherwise clamd just sees 'SESSIONPING'.


Another suggestion, then, (probably has already been made and maybe even implemented) would be a session command with a response. This combines SESSION and PING (could we call it SESSIONPING? Sounds daft, but...) and does the job of both.

It would require something like:

        else if(!strncmp(buff, CMD13, strlen(CMD13)))
        { /* SESSIONPING */
                mdprintf(desc, "PONG\n");
                return COMMAND_SESSION;
        }

to be added to session.c.

CMD13 is "SESSIONPING", or whatever is preferred.

This avoids having to guess what delay to introduce, and avoids the issue of successive writes, while not breaking any existing code.

Colin MacDonald

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to