SqueakMap HTTP Response code handling (was Re: EOCD error: (was Problem loading FFI))

Brian Rice water at tunes.org
Thu Aug 16 22:29:26 UTC 2007


What is the appropriate way in Squeak to check for HTTP error  
messages, then? Maybe I can fix this pretty quickly. The (only,  
thankfully) relevant line in SqueakMap is in SMFileCache>>getStream:  
which does:

| stream |
[stream := aDownloadable downloadUrl asUrl retrieveContents  
contentStream binary.
	(aDownloadable correctSha1sum: stream contents)
		ifFalse: [self error: 'Incorrect SHA checksum of file from orginal  
URL']]
		on: Exception do: [:ex |
			Transcript show: 'Download from original url (', aDownloadable  
downloadUrl, ') failed with this exception: ', ex messageText;cr.
...

I assume that the first line of this method needs to be split up so  
that we can check the response code at some point. Someone more  
knowledgeable than me, could you point out how to do this?

I looked at some senders of retrieveContents, and none seem to check  
response codes, so there is likely a lot of improvement to be made  
across the board in this area.

On Aug 16, 2007, at 12:18 PM, Enno Schwass wrote:

> Hello
>
>> First let me explain that the mysterious EOCD message is an unzipping
>> error message.  The SqueakMap client fetches some data and thinks  
>> it is
>> a SAR or MCZ or some other zipped content and blithely hands it  
>> over to
>> be unzipped, the unzipper barfs on it because in fact it is an HTTP
>> error message and not zipped at all.  So at best the complaint  
>> could be
>> here that the client does not properly check for HTTP error messages.
>
> Now things get clearer. I was complaining about EOCD error, too.
>
> Thanks for the explanation
> Enno

--
-Brian
http://briantrice.com




More information about the Squeak-dev mailing list