about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-05 01:31:44 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-05 01:31:44 -0800
commit630501f6214a8d44bd2e7a5ae43badf2c0e093f8 (patch)
tree8a0ce33b9b0807bc54de942197c413a0c86f329a
parenteb0b56d71731d2dbcfe4022b202677b9173ef81d (diff)
downloadrainbows-630501f6214a8d44bd2e7a5ae43badf2c0e093f8.tar.gz
We're simply too uncomfortable with the weird GC issues
associated with Tempfile and having linked temporary files at
all.  Instead just depend on the #size-aware TmpIO class that
Unicorn 0.94.0 provides for us.
-rw-r--r--lib/rainbows/ev_core.rb7
-rw-r--r--rainbows.gemspec2
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb
index f90e1e1..2679b5a 100644
--- a/lib/rainbows/ev_core.rb
+++ b/lib/rainbows/ev_core.rb
@@ -1,7 +1,5 @@
 # -*- encoding: binary -*-
 
-require 'tempfile'
-
 module Rainbows
 
   # base module for evented models like Rev and EventMachine
@@ -56,8 +54,7 @@ module Rainbows
             write(EXPECT_100_RESPONSE)
             @env.delete(HTTP_EXPECT)
           end
-          @input = len && len <= MAX_BODY ?
-                   StringIO.new("") : Tempfile.new(nil).binmode
+          @input = len && len <= MAX_BODY ? StringIO.new("") : Util.tmpio
           @hp.filter_body(@buf2 = @buf.dup, @buf)
           @input << @buf2
           on_read("")
@@ -74,7 +71,7 @@ module Rainbows
       when :trailers
         if @hp.trailers(@env, @buf << data)
           app_call
-          @input.close! if Tempfile === @input
+          @input.close if File === @input
         end
       end
       rescue Object => e
diff --git a/rainbows.gemspec b/rainbows.gemspec
index dea8603..9237dfc 100644
--- a/rainbows.gemspec
+++ b/rainbows.gemspec
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
   s.test_files = test_files
 
   # we need Unicorn for the HTTP parser and process management
-  s.add_dependency(%q<unicorn>, ["~> 0.93.5"])
+  s.add_dependency(%q<unicorn>, ["~> 0.94.0"])
 
   # Unicorn already depends on Rack
   # s.add_dependency(%q<rack>)