Property changes on: grizzly/jruby/src/main/java/com/sun/grizzly/jruby ___________________________________________________________________ Name: svn:ignore + .RailsAdapter.java.swp Index: grizzly/jruby/src/main/java/com/sun/grizzly/jruby/RailsAdapter.java =================================================================== --- grizzly/jruby/src/main/java/com/sun/grizzly/jruby/RailsAdapter.java (revision 393) +++ grizzly/jruby/src/main/java/com/sun/grizzly/jruby/RailsAdapter.java (working copy) @@ -185,9 +185,6 @@ } public void service(GrizzlyRequest req, GrizzlyResponse res) { - // Commit the response so Grizzly doesn't add its own headers. - res.getResponse().setCommitted(true); - Ruby runtime = null; try { runtime = pool.borrowObject(); @@ -246,9 +243,17 @@ loadRuntimeEnvironment(runtime); + // Vivek: Why passing the Request here instead of GrizzlyRequest? + // The GrizzlyInputStream/OutputStream is passed with the Request + // which is a mix and match for me. IRubyObject[] args = {JavaEmbedUtils.javaToRuby(runtime, req.getRequest())}; IRubyObject responder = runtime.getGlobalVariables().get("$responder"); JavaEmbedUtils.invokeMethod(runtime, responder, "service", args, IRubyObject.class); + + // If we ends up here it means Grizzly wasn't able to server the request + // Hence we gonna delegate the complete handling of the request to + // The Rail runtime. + res.setSuspended(true); } catch (RaiseException e) { getLogger().log(Level.SEVERE, e.getLocalizedMessage(), e); RubyException exception = e.getException(); @@ -344,6 +349,5 @@ } catch (IOException ex){} } } - res.setCommitted(true); } }