about summary refs log tree commit homepage
path: root/lib/mogilefs/http_file.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-11-05 02:34:35 +0000
committerEric Wong <normalperson@yhbt.net>2011-11-05 02:34:35 +0000
commit283050fc283868f79796f05901bd9149713ae282 (patch)
tree60b5f97790421689e2e84f709f7a22d61c7ff9da /lib/mogilefs/http_file.rb
parentf057a82730d252c509f8c590430dbf4507d17601 (diff)
downloadmogilefs-client-283050fc283868f79796f05901bd9149713ae282.tar.gz
Avoid deepening stack depth and make it easier to migrate
fully to 1.9 in the future (dropping 1.8 support).
Diffstat (limited to 'lib/mogilefs/http_file.rb')
-rw-r--r--lib/mogilefs/http_file.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/mogilefs/http_file.rb b/lib/mogilefs/http_file.rb
index 22692e7..261e209 100644
--- a/lib/mogilefs/http_file.rb
+++ b/lib/mogilefs/http_file.rb
@@ -3,7 +3,6 @@
 require 'stringio'
 require 'uri'
 require 'mogilefs/backend'
-require 'mogilefs/util'
 
 ##
 # HTTPFile wraps up the new file operations for storing files onto an HTTP
@@ -13,8 +12,6 @@ require 'mogilefs/util'
 # create a new file using MogileFS::MogileFS.new_file.
 #
 class MogileFS::HTTPFile < StringIO
-  include MogileFS::Util
-
   class EmptyResponseError < MogileFS::Error; end
   class BadResponseError < MogileFS::Error; end
   class UnparseableResponseError < MogileFS::Error; end
@@ -63,11 +60,11 @@ class MogileFS::HTTPFile < StringIO
       end)
     elsif @big_io
       # Don't try to run out of memory
-      File.open(@big_io, "rb") do |fp|
+      File.open(@big_io) do |fp|
         file_size = fp.stat.size
         sock.write("PUT #{uri.request_uri} HTTP/1.0\r\n" \
                    "Content-Length: #{file_size}\r\n\r\n")
-        copy_stream(fp, sock)
+        MogileFS::X.copy_stream(fp, sock)
       end
     else
       sock.write("PUT #{uri.request_uri} HTTP/1.0\r\n" \