about summary refs log tree commit homepage
path: root/lib/mogilefs/mogilefs.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-12-08 15:53:09 -0800
committerEric Wong <normalperson@yhbt.net>2011-12-08 15:53:09 -0800
commit50f9287610725257bf64781a2008398ff6ceeacb (patch)
tree049bdc3151d4d87ec78b2e292b999607374e963e /lib/mogilefs/mogilefs.rb
parenta867de1e6bdf50bb7cb4316a7ecf3a9a38c9029b (diff)
downloadmogilefs-client-50f9287610725257bf64781a2008398ff6ceeacb.tar.gz
new_file(..., :largefile => :stream) avoids chunking
This allows us to stream files with a known Content-Length
into MogileFS.  This can be useful for streaming an HTTP
download into MogileFS without:

* saving it to the filesystem
* relying on chunked encoding support on the server
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r--lib/mogilefs/mogilefs.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb
index 40927d4..50484d8 100644
--- a/lib/mogilefs/mogilefs.rb
+++ b/lib/mogilefs/mogilefs.rb
@@ -162,7 +162,7 @@ class MogileFS::MogileFS < MogileFS::Client
     case (dests[0][1] rescue nil)
     when %r{\Ahttp://}
       http_file = case opts[:largefile]
-                  when :chunked
+                  when :chunked,:stream
                     MogileFS::HTTPStream
                   when :tempfile
                     require 'mogilefs/http_tempfile'