Sounds fine to me from your description...<br><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 3:12 PM, Lukas Renggli <span dir="ltr">&lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">&gt; I think Lukas actually ran into problems with this... Lukas?<br>
<br>
</div>Yes, I am totally frustrated. I have an image full of dirty packages<br>
and everything is broken. ;-)<br>
<br>
The problem is that WACodec is not suitable for streaming:<br>
<br>
- WACodec works with Strings instead of Streams. So whenever you<br>
convert something a copy is created.<br>
<br>
- WACodec instances are singletons. They use a critical section to do<br>
the conversion. I wonder why nobody has ever complained? Today when a<br>
request/response is converted all other request handling is basically<br>
suspended.<br>
<br>
I suggest the following refactoring, but I need help because it<br>
affects a lot of code:<br>
<br>
- Change WACodec to a factory object for stream encoder/decoder.<br>
<br>
- The WACodec class to be used is specific in the WAServerAdaptor.<br>
<br>
- WANullCodec is the default codec to be used and the only one shipped<br>
with Seaside-Core. It does nothing and provides the legacy WAKom<br>
behavior.<br>
<br>
- WACodec understands the methods #encoderFor:, #decoderFor:,<br>
#urlEncoderFor:, #urlDecoderFor:, ... and wraps streams with platform<br>
specific encoding strategies. Most platforms (with the exception of<br>
Pharo) have highly efficient stream wrapper in their core library that<br>
can be answered here.<br>
<br>
- Platforms provide a limited set of useful subclasses of WACodec,<br>
like WAUtf8NativeCodec, WAUtf8Utf8Codec, WAIsoUtf8Codec, etc. One<br>
could also think of codexes that configure themselves using one of the<br>
detection strategies in other web frameworks.<br>
<br>
This kind of refactoring avoids unnecessary copying around and works<br>
well with buffered and streamed request processing. The streamed<br>
server currently includes an ugly hack and a lot of platform dependent<br>
duplicated code to enable encoding.<br>
<br>
What do you think?<br>
<div class="Ih2E3d"><br>
Lukas<br>
<br>
--<br>
Lukas Renggli<br>
<a href="http://www.lukas-renggli.ch" target="_blank">http://www.lukas-renggli.ch</a><br>
</div><div><div></div><div class="Wj3C7c">_______________________________________________<br>
seaside-dev mailing list<br>
<a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
</div></div></blockquote></div><br>