[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaSocket: No way to protect against fuzzing attacks?
- From: Peter Pimley <peter.pimley@...>
- Date: Tue, 11 Oct 2011 11:55:43 +0100
On 11 October 2011 11:07, HyperHacker <hyperhacker@gmail.com> wrote:
> Hmm, according to the manual, receive() should return the partial
> result after the error message, but I'm getting inconsistent results.
> If I use *l, it always returns the full result, but *l strips the line
> break character, so I can't tell if the line has actually ended
If the line did actually end then it'll be the first result from
receive(). If a timeout occured then the results will be nil,
"timeout" and then the partial line.
Sean Connor pointed out that repeated calls with a zero timeout will
burn performance. Perhaps you could use a timeout that starts off as
the maximum reasonable request time, and gradually decreases after
each successful call.