Adam Brown wrote:
While adding SSL support to our project using SslFilter, I ran into
the problem where SslFilter does not handle writes of FileRegions.
SslFilter.filterWrite() casts the message in the WriteRequest to an
IoBuffer. However, this doesn't work for FileRegions (leading to a
ClassCastException).
Has anyone else run afoul of this issue? Apart from sticking another
IoFilter in the chain "before" the SslFilter to convert the FileRegion
into an equivalent IoBuffer, is there another/better solution?
Well, as the SSLFilter is the first one in the chain, it has to send
byte[] to the client. Not sure that it implies it should receive an
IoBuffer, as in your case it would have made sense that it was able to
accept FileRegion...
Sadly, it's currently a limitation. You have to add a converter, or you
can extend the current SSLFilter to handle a FileRegion instead of a
IoBuffer.
I guess you will just have to overload the filterWrite() method, calling
its super.filterWite() when the conversion is done. A bit of a hack, but ...
Hope it helps.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org