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-14 09:55:01 +0000
committerEric Wong <normalperson@yhbt.net>2011-11-14 09:55:01 +0000
commit754b8077b55e37627c32d1339227001d509d8517 (patch)
tree4de4a1e0b89e2def666a942790299d9c7799e5d0 /lib/mogilefs/http_file.rb
parentb8b0c8003ca16cc123c99e91fa65e8702a02a86f (diff)
downloadmogilefs-client-754b8077b55e37627c32d1339227001d509d8517.tar.gz
Since we can either rewind it or we can't, we shouldn't
reopen already-opened files.
Diffstat (limited to 'lib/mogilefs/http_file.rb')
-rw-r--r--lib/mogilefs/http_file.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/http_file.rb b/lib/mogilefs/http_file.rb
index 96e9887..064447f 100644
--- a/lib/mogilefs/http_file.rb
+++ b/lib/mogilefs/http_file.rb
@@ -91,7 +91,7 @@ class MogileFS::HTTPFile < StringIO
       file_size = put_streaming_io(sock, uri)
     elsif @big_io
       if String === @big_io || @big_io.respond_to?(:to_path)
-        file = File.open(@big_io)
+        file ||= File.open(@big_io)
         stat = file.stat
         file_size = request_put(sock, uri, stat.file? ? stat.size : nil, file)
       else