From d7bec4c903bd08337b7dbf4611e618762050ed58 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 7 Dec 2011 01:24:24 +0000 Subject: [PATCH] Revert "http_file: disable MD5 checksums by default" This reverts commit 11ee57e7aaa8766d13e29d3872bd78d50a3e5263. Bleh, checksums support is already off by default... --- lib/mogilefs/http_file.rb | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/mogilefs/http_file.rb b/lib/mogilefs/http_file.rb index 1c8acd7..b8bfd48 100644 --- a/lib/mogilefs/http_file.rb +++ b/lib/mogilefs/http_file.rb @@ -177,18 +177,13 @@ class MogileFS::HTTPFile < StringIO :size => bytes_uploaded, :path => uri.to_s, } - - # checksums are not yet supported in upstream MogileFS as of 2011-12-06 - if @opts[:MD5] - if @md5 - args[:checksum] = "MD5:#{@md5.hexdigest}" - elsif String === @opts[:content_md5] - hex = @opts[:content_md5].unpack('m')[0].unpack('H*')[0] - args[:checksum] = "MD5:#{hex}" - end - args[:checksumverify] = 1 if @opts[:checksumverify] + if @md5 + args[:checksum] = "MD5:#{@md5.hexdigest}" + elsif String === @opts[:content_md5] + hex = @opts[:content_md5].unpack('m')[0].unpack('H*')[0] + args[:checksum] = "MD5:#{hex}" end - + args[:checksumverify] = 1 if @opts[:checksumverify] @opts[:backend].create_close(args) bytes_uploaded end -- 2.11.4.GIT