about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/rainbows/ev_core.rb3
-rw-r--r--lib/rainbows/rev.rb2
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb
index aa0b155..d8304a3 100644
--- a/lib/rainbows/ev_core.rb
+++ b/lib/rainbows/ev_core.rb
@@ -19,12 +19,10 @@ module Rainbows
 
     # graceful exit, like SIGQUIT
     def quit
-      @deferred_bodies.clear
       @state = :close
     end
 
     def handle_error(e)
-      quit
       msg = case e
       when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF
         ERROR_500_RESPONSE
@@ -36,6 +34,7 @@ module Rainbows
         ERROR_500_RESPONSE
       end
       write(msg)
+      quit
     end
 
     def tmpio
diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb
index 572b88a..89f893a 100644
--- a/lib/rainbows/rev.rb
+++ b/lib/rainbows/rev.rb
@@ -62,7 +62,7 @@ module Rainbows
             # keepalive requests are always body-less, so @input is unchanged
             @hp.headers(@env, @buf) and next
           else
-            @state = :close
+            quit
           end
           return
         end while true