From: Andreas K. <and...@ac...> - 2006-10-30 22:20:34
|
> I've updated TIP #287 (which proposes a [chan available]) command with > a pointer to the reference implementation/patch at SourceForge (RFE > 1586860). See: http://www.tcl.tk/cgi-bin/tct/tip/287.html. > The patch also includes updated man pages and test cases. > > Naturally feedback is appreciated. I think this should be a > relatively uncontroversial TIP as it fits in nicely with the new > [chan] command in 8.5 (and will help authors of network daemons to > avoid a certain class of DoS attacks). Michael, your are quoting from fileevent.n: A channel is also considered to be readable if there is unread data in an input buffer, except in the special case where the most recent attempt to read from the channel was a gets call that could not find a complete line in the input buffer. I am not aware of this special case, and think that the manpage might be wrong. ... Writing a test script ... Ok I seem to be wrong. Using the attached scripts (yyy = sender incomplete line, zzz = sender complete line, xxx = receiver), I find that after each push of an incomplete line to the socket the receiver calls the event handler only twice and then stops. Until the next chunk is received. Without the special case it would expect it to execute the handler rapidly without stopping, until the line has been completed ... Interesting. Now I am wondering how this is implemented. Ok, I also found an older RFE by Colin McCormack http://sourceforge.net/tracker/index.php?func=detail&aid=1399062&group_id=10894& atid=360894 gets with limited line-length I think this should be discussed in the TIP -- Andreas Kupries <and...@Ac...> Developer @ http://www.ActiveState.com Tel: +1 778-786-1122 |