From f6de63cfcbddd289a016f529e67604d5486091f5 Mon Sep 17 00:00:00 2001 From: cinwell Date: Thu, 22 May 2014 22:49:40 +0800 Subject: [PATCH 1/2] Update RSFClient.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 98行增加limit参数 --- Qiniu/RSF/RSFClient.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Qiniu/RSF/RSFClient.cs b/Qiniu/RSF/RSFClient.cs index 9cee86d4..9fe61921 100644 --- a/Qiniu/RSF/RSFClient.cs +++ b/Qiniu/RSF/RSFClient.cs @@ -95,7 +95,7 @@ public RSFClient (string bucketName) /// /// Limit. /// - public DumpRet ListPrefix (string bucketName, string prefix="", string markerIn="") + public DumpRet ListPrefix (string bucketName, int limit=0, string prefix="", string markerIn="") { string url = Config.RSF_HOST + string.Format ("/list?bucket={0}", bucketName);// + bucketName + if (!string.IsNullOrEmpty (markerIn)) { @@ -104,7 +104,8 @@ public DumpRet ListPrefix (string bucketName, string prefix="", string markerIn= if (!string.IsNullOrEmpty (prefix)) { url += string.Format ("&prefix={0}", prefix); } - if (this.limit > 0) { + if (limit > 0) + { url += string.Format ("&limit={0}", limit); } for (int i = 0; i < RETRY_TIME; i++) { @@ -151,7 +152,7 @@ public List Next () return null; } try { - DumpRet ret = ListPrefix (this.bucketName, this.prefix, this.marker); + DumpRet ret = ListPrefix (this.bucketName,this.limit, this.prefix, this.marker); if (ret.Items.Count == 0) { end = true; return null; From 99b8e33690b8b6f7198fcce41ce19f13a90c1010 Mon Sep 17 00:00:00 2001 From: QingWei-Li Date: Fri, 23 May 2014 08:18:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E4=B8=8E=E5=8E=9F=E5=A7=8B=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Qiniu/RSF/RSFClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Qiniu/RSF/RSFClient.cs b/Qiniu/RSF/RSFClient.cs index 9fe61921..5f2e7f9c 100644 --- a/Qiniu/RSF/RSFClient.cs +++ b/Qiniu/RSF/RSFClient.cs @@ -95,7 +95,7 @@ public RSFClient (string bucketName) /// /// Limit. /// - public DumpRet ListPrefix (string bucketName, int limit=0, string prefix="", string markerIn="") + public DumpRet ListPrefix(string bucketName, string prefix = "", string markerIn = "", int limit = 0) { string url = Config.RSF_HOST + string.Format ("/list?bucket={0}", bucketName);// + bucketName + if (!string.IsNullOrEmpty (markerIn)) { @@ -152,7 +152,7 @@ public List Next () return null; } try { - DumpRet ret = ListPrefix (this.bucketName,this.limit, this.prefix, this.marker); + DumpRet ret = ListPrefix(this.bucketName, this.prefix, this.marker, this.limit); if (ret.Items.Count == 0) { end = true; return null;