From c77ec9762035b61e9e8eda6a061e2e97ac87305b Mon Sep 17 00:00:00 2001 From: Liang Tao Date: Tue, 8 Apr 2014 16:52:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8F=A6=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=8F=AF=E8=83=BD=E5=BC=95=E5=8F=91=E5=A4=A7=E9=87=8F?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E7=9A=84Bug=E7=82=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/qiniu/rs/up.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/qiniu/rs/up.rb b/lib/qiniu/rs/up.rb index 57f3da0..0049acf 100755 --- a/lib/qiniu/rs/up.rb +++ b/lib/qiniu/rs/up.rb @@ -200,6 +200,8 @@ module Qiniu break elsif i == retry_times && data["crc32"] != body_crc32 Log.logger.error %Q(Uploading block error. Expected crc32: #{body_crc32}, but got: #{data["crc32"]}) + # 上传重试达到上限,直接返回错误 + return [code, data] end end elsif progress[:offset] + progress[:restsize] != block_size From a031645e3cc81b54bbe172b871cf3d17dfe7ece2 Mon Sep 17 00:00:00 2001 From: Liang Tao Date: Fri, 18 Apr 2014 16:50:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89publish/unpublish?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=B0=81=E8=A3=85=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ Gemfile.lock | 2 +- lib/qiniu/rs.rb | 10 ---------- lib/qiniu/rs/rs.rb | 10 ---------- lib/qiniu/rs/version.rb | 2 +- spec/qiniu/rs/rs_spec.rb | 18 ------------------ spec/qiniu/rs_spec.rb | 21 --------------------- 7 files changed, 6 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f076ea7..c20d99d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## CHANGE LOG +### v3.4.9 + +- 去掉publish和unpublish接口的封装函数。 (#8143) + ### v3.4.8 - 修复断点续上传功能中一直重试上传出错片的Bug。[https://github.com/qiniu/ruby-sdk/pull/87](https://github.com/qiniu/ruby-sdk/pull/87) (#7205) diff --git a/Gemfile.lock b/Gemfile.lock index 455a3d1..aaebdfa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - qiniu-rs (3.4.8) + qiniu-rs (3.4.9) json (~> 1.7) mime-types (~> 1.19) rest-client (~> 1.6) diff --git a/lib/qiniu/rs.rb b/lib/qiniu/rs.rb index d11b0bc..e34f9b7 100755 --- a/lib/qiniu/rs.rb +++ b/lib/qiniu/rs.rb @@ -204,16 +204,6 @@ module Qiniu code == StatusOK ? data : false end - def publish(domain, bucket) - code, data = RS.publish(domain, bucket) - code == StatusOK - end - - def unpublish(domain) - code, data = RS.unpublish(domain) - code == StatusOK - end - def drop(bucket) code, data = RS.drop(bucket) code == StatusOK diff --git a/lib/qiniu/rs/rs.rb b/lib/qiniu/rs/rs.rb index 932b231..779e8e6 100755 --- a/lib/qiniu/rs/rs.rb +++ b/lib/qiniu/rs/rs.rb @@ -40,16 +40,6 @@ module Qiniu Auth.request Config.settings[:rs_host] + '/delete/' + encode_entry_uri(bucket, key) end - def publish(domain, bucket) - encoded_domain = Utils.urlsafe_base64_encode(domain) - Auth.request Config.settings[:rs_host] + "/publish/#{encoded_domain}/from/#{bucket}" - end - - def unpublish(domain) - encoded_domain = Utils.urlsafe_base64_encode(domain) - Auth.request Config.settings[:rs_host] + "/unpublish/#{encoded_domain}" - end - def drop(bucket) Auth.request Config.settings[:rs_host] + "/drop/#{bucket}" end diff --git a/lib/qiniu/rs/version.rb b/lib/qiniu/rs/version.rb index b2ca677..a02ed08 100755 --- a/lib/qiniu/rs/version.rb +++ b/lib/qiniu/rs/version.rb @@ -5,7 +5,7 @@ module Qiniu module Version MAJOR = 3 MINOR = 4 - PATCH = 8 + PATCH = 9 # Returns a version string by joining MAJOR, MINOR, and PATCH with '.' # # Example diff --git a/spec/qiniu/rs/rs_spec.rb b/spec/qiniu/rs/rs_spec.rb index 41cd19d..8d631b0 100755 --- a/spec/qiniu/rs/rs_spec.rb +++ b/spec/qiniu/rs/rs_spec.rb @@ -123,24 +123,6 @@ module Qiniu end end -=begin - context ".publish" do - it "should works" do - code, data = Qiniu::RS::RS.publish(@domain, @bucket) - code.should == 200 - puts data.inspect - end - end - - context ".unpublish" do - it "should works" do - code, data = Qiniu::RS::RS.unpublish(@domain) - code.should == 200 - puts data.inspect - end - end -=end - context ".move" do it "should works" do code, data = Qiniu::RS::RS.move(@bucket, @key, @bucket, @key2) diff --git a/spec/qiniu/rs_spec.rb b/spec/qiniu/rs_spec.rb index 83ba74c..8136f53 100755 --- a/spec/qiniu/rs_spec.rb +++ b/spec/qiniu/rs_spec.rb @@ -32,9 +32,6 @@ module Qiniu end after :all do - #result = Qiniu::RS.unpublish(@domain) - #result.should_not be_false - result1 = Qiniu::RS.drop(@bucket) puts result1.inspect result1.should_not be_false @@ -278,24 +275,6 @@ module Qiniu end end -=begin - context ".publish" do - it "should works" do - result = Qiniu::RS.publish(@domain, @bucket) - result.should_not be_false - end - end -=end - -=begin - context ".unpublish" do - it "should works" do - result = Qiniu::RS.unpublish(@domain) - result.should_not be_false - end - end -=end - context ".batch_copy" do it "should works" do result = Qiniu::RS.batch_copy @bucket, @key, @bucket, @key2 From cfa75c7e2866aaf10f1a638b2bd2119a842e709d Mon Sep 17 00:00:00 2001 From: Liang Tao Date: Fri, 18 Apr 2014 16:53:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0PR=E5=8F=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c20d99d..a8e2709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### v3.4.9 -- 去掉publish和unpublish接口的封装函数。 (#8143) +- 去掉publish和unpublish接口的封装函数。 [https://github.com/qiniu/ruby-sdk/pull/89](https://github.com/qiniu/ruby-sdk/pull/89) (#8143) ### v3.4.8