[squeak-dev] Re: Flaw in SocketStream>>peek detected

Andreas Raab andreas.raab at gmx.de
Thu Jan 14 06:29:57 UTC 2010


Igor Stasenko wrote:
> The fix is:
> 
> ---	^inBuffer at: lastRead
> +++	^inBuffer at: lastRead+1
> 
> 
> but i'm not sure if something else won't break because of it ;)

Extremely unlikely. It's pretty clear that peek is wrong here as 
illustrated by:

stream := SocketStream openConnectionToHostNamed: 'www.google.com' port: 80.
stream nextPutAll:('GET / HTTP/1.0\\' copyReplaceAll: '\'with: String crlf).
stream flush.
stream peek.

This blows up and clearly it shouldn't.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list