[Bese-devel] Re: A few UCW issues

Marco Baringer mb at bese.it
Mon May 29 18:48:05 UTC 2006


"Marijn Haverbeke" <marijnh at gmail.com> writes:

> Hello list,
>
> If this is not the right place for questions concerning UCW, please point me to
> wherever those are appropriate.

this is the right place, the name of the list is due to ucw having
grown out the bese umbrella project on cl.net. as it currently stands
there is 95% ucw chat on this list and 5% arnesi+fiveam+qbook chat, so
be it.

> I've started trying to get a UCW project off the ground a few weeks ago, and by
> now I'm starting to get somewhat comfortable with the framework. A few things I
> haven't managed to figure out yet though:
>
> - Is there a supported way to get header variables out of a request object? I
> can just access the headers slot using ucw::headers, but that's not very nice.
>
> - Also, is there a way to set headers for a response? I need one header added
> to every response the server generates, but I haven't been able to find a way
> to even set a header in a single response.

the get-header and (setf get-header) methods are defined for both
request and response object. [get-header on a response is silly, as is
(setf get-header) on a request].

currently there is no 'normalizing' of headers, so if IE for mac
decides to send the header as Accept-encoding, and the rest of world
does it as Accept-Encoding you're sol.

> - Is it a problem to call multiple components that never answer? I suppose this
> would build up some kind of call stack... is there a way to do a 'tail call' -
> replacing the current component with another one?

yes, a component which never answers will cause its parent component
to never get garbage collected. unlike some other things in ucw (like
infinite length frame lists and request callbacks) extra components
have a minimal overhead. I wouldn't worry about it until profiling
shows that it's a problem (and i promise you it will never be as big a
problem as writing the html out).

if it were to give you warm fuzzy feelings here's what you'd need to
do:

(setf (component.calling-component my-component) nil)

where my-component is the one that nevers answer. now, as long as
nobody else has a reference to my-component's calling component, your
lisp is free to GC the 60 or so bytes occupied by the component.

hth.
-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen




More information about the bese-devel mailing list