about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-12-22 20:08:56 -0800
committerEric Wong <normalperson@yhbt.net>2008-12-22 20:08:56 -0800
commit8e44957300037c8bfd029fb21b665ceb98e7817a (patch)
tree27f9c9f03cbb360842f4523868ec59de9f2f9624 /lib
parent16cfeeb035c0c0362e8f4fb1707f9006573defc1 (diff)
downloadmogilefs-client-8e44957300037c8bfd029fb21b665ceb98e7817a.tar.gz
"bigfile" is used by the large file support, too.
"big_io" also allows an IO object to be sent to us, as well
(and not a pathname)
Diffstat (limited to 'lib')
-rw-r--r--lib/mogilefs/httpfile.rb12
-rw-r--r--lib/mogilefs/mogilefs.rb2
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/mogilefs/httpfile.rb b/lib/mogilefs/httpfile.rb
index 0c8316b..67e68c1 100644
--- a/lib/mogilefs/httpfile.rb
+++ b/lib/mogilefs/httpfile.rb
@@ -40,9 +40,9 @@ class MogileFS::HTTPFile < StringIO
   attr_reader :class
 
   ##
-  # The bigfile name in case we have file > 256M
+  # The big_io name in case we have file > 256M
 
-  attr_accessor :bigfile
+  attr_accessor :big_io
 
   ##
   # Works like File.open.  Use MogileFS::MogileFS#new_file instead of this
@@ -72,7 +72,7 @@ class MogileFS::HTTPFile < StringIO
     @devid = devid
     @klass = klass
     @key = key
-    @bigfile = nil
+    @big_io = nil
 
     @dests = dests.map { |(_,u)| URI.parse u }
     @tried = {}
@@ -87,9 +87,9 @@ class MogileFS::HTTPFile < StringIO
     connect_socket
 
     file_size = nil
-    if @bigfile
+    if @big_io
       # Don't try to run out of memory
-      File.open(@bigfile) do |fp|
+      File.open(@big_io) do |fp|
         file_size = fp.stat.size
         @socket.mogilefs_tcp_cork = fp.sync = true
         @socket.send("PUT #{@path.request_uri} HTTP/1.0\r\n" \
@@ -125,7 +125,7 @@ class MogileFS::HTTPFile < StringIO
     @mg.backend.create_close(:fid => @fid, :devid => @devid,
                              :domain => @mg.domain, :key => @key,
                              :path => @path, :size => length)
-    return file_size if @bigfile
+    return file_size if @big_io
     return nil
   end
 
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb
index 20756f9..b7e2325 100644
--- a/lib/mogilefs/mogilefs.rb
+++ b/lib/mogilefs/mogilefs.rb
@@ -155,7 +155,7 @@ class MogileFS::MogileFS < MogileFS::Client
         return sysrwloop(file, mfp)
       else
         if File.size(file) > 0x10000 # Bigass file, handle differently
-          mfp.bigfile = file
+          mfp.big_io = file
           return
         else
           return File.open(file) { |fp| sysrwloop(fp, mfp) }