I am attempting to use Mina to build a scalable Ajax web application
test harness, (a Mina client). So far, so good... :-).

One quick question: I have an operational HTTP message decoder in place,
but I am not sure how to support the parsing of a complete HTTP response
when the HTTP Content-length is not known. In particular, I need to know
when the underling session is closing, (IoSession.isClosing() == true),
while parsing the last packet from the server. It seems this is not now
the case. I will eventually get an IoHander.sessionClosing() callback,
but the undecoded message is left hanging out there with decodable()
returning false.

To hack this, I figure I could add a last "unknown content length"
ByteBuffer as a session attribute from MessageDecoder.decodable(),
(carefully acquire() and release() managed), and process it on
IoHandler.sessionClosing() manually. This seems kind of ugly and not
within the spirit of the Mina API. Any suggestions how to better handle
this?

Thanks,

Randy Watler



Reply via email to