[Seaside] Backtracking/filestream questions

Colin Curtin alpine at umail.ucsb.edu
Sun Mar 14 08:00:55 CET 2004


This is such a great framework! I've stayed up many, many nights just so
addicted to getting things working in Seaside. Why does Squeak have to be so
addictive to program in? Sort of like caffeine, only without the...

Anyway, I had a few questions regarding some things I'm working on, and some
troubles I've run across.

1) I have written a Seaside proxy in which you enter a URL for a webpage you
would like to view, and it displays it below the title bar. Its functionality
is similar to Anonymizer or Guardster. The problem is that I have code which
looks like:

document _ aUrl retrieveContents contents

#retrieveContents has to perform a namelookup on the URL, which requires a
semaphore'd shared resource. Since (for some odd reason) I've allowed this app
to use backtracking, the state is saved for the session time (5min I think),
therefore I can only look at about ten pages until I've used up all of the
namelookups.

My workaround was to obtain the reference to the *really* obscure semaphore
through debug and set it to nil to clear it out.

I read through this list today and found something that will probably work
perfectly: just displaying a "main bar", and then having a method that renders
content for me, without registering for backtracking. Will this solve the
session/semaphore problem?

2) Another thing that I've written is a FileBrowser which allows you to browse
the 'home directory' (the one that Squeak was launched from), its
subdirectories, and also download the files that you find there. This is
similar to Apache's default file browser (except that I'm still trying to find
a way to display the filesize/date modified).

The problem is that files are loaded into memory before being sent out to the
requestor. This is really bad for, say, 500MB files which make Squeak use up
all of the memory + swap to get the file out the door. Interestingly, this is
also the method I'm using for image proxying in my other project.

As an aside, the bandwidth for files that are served through this method is
about 500KB/s (to localhost) ;D

Is there a elegant way to attach a filestream to the outgoing httpstream?

Thanks in advance, and sorry about the long post!


Colin Curtin



More information about the Seaside mailing list