dev@grizzly.java.net

DefaultProtocolChain bug?

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Wed, 09 Jan 2008 14:06:00 +0100

Hello,

when investigating one of the Sailfin issue, I found that current
DefaultProtocolChain exception control could be improved.
Think we should catch *all* types of Exceptions on execution phase and
call postExecute on all filters, which were passed before exception
happened.

Here is proposed fix attached.

Thanks.

WBR,
Alexey.


Index: DefaultProtocolChain.java
===================================================================
--- DefaultProtocolChain.java (revision 690)
+++ DefaultProtocolChain.java (working copy)
@@ -88,7 +88,9 @@
         for (int i=0; i < size; i++){
             try{
                 invokeNext = protocolFilters.get(i).execute(ctx);
- } catch (IOException ex){
+ } catch (Exception ex){
+ invokeNext = false;
+ i--;
                 Controller.logger().log(Level.SEVERE,
                         "ProtocolChain exception",ex);
             }
@@ -114,7 +116,7 @@
             try{
                 tmpHandler = protocolFilters.get(i);
                 invokeNext = tmpHandler.postExecute(ctx);
- } catch (IOException ex){
+ } catch (Exception ex){
                 Controller.logger().log(Level.SEVERE,
                         "ProtocolChain exception",ex);
             }