From 6d618ae6b83d893c6dee0d931ca2d5847cf0f598 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 10 Mar 2009 18:02:35 -0700 Subject: HttpRequest: set binmode on tempfiles Just in case this stupid Ruby 1.9-ism creeps up on someone; I haven't been able to reproduce I/O corruption from the test cases, but better safe than sorry here. --- lib/unicorn/http_request.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 6e909b6..b06e3ae 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -99,6 +99,7 @@ module Unicorn @body = StringIO.new(http_body) else # huge body, put it in a tempfile @body = Tempfile.new(Const::UNICORN_TMP_BASE) + @body.binmode @body.sync = true @body.syswrite(http_body) end -- cgit v1.2.3-24-ge0c7