[squeak-dev] Re: Flaw in SocketStream>>peek detected
John M McIntosh
johnmci at smalltalkconsulting.com
Thu Jan 14 17:29:49 UTC 2010
Yes I dd run the code and it doesn't handle the edge case of what happens when no-one before has read any bytes.
I was just pointing out the fact that peeking on a socket is complicated and one needs to think more carefully about all possible outcomes
On 2010-01-13, at 11:06 PM, Andreas Raab wrote:
> John M McIntosh wrote:
>> Er, well also it's a timing issue just because you did the nextPutAll: and the flush.
>
> It's not a timing issue. Please run the code - it blows up after the response is received with an index out of bounds: 0 because it's trying to access lastRead and lastRead is zero at this point (nothing has been read thus far). No timing issues involved.
>
> Cheers,
> - Andreas
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> Twitter: squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|