From 5a1212eb124c2daa1aeea6aac0a4e3e75c9cdda6 Mon Sep 17 00:00:00 2001 From: guozhandong <18896723979@139.com> Date: Tue, 15 Nov 2016 17:03:14 +0800 Subject: [PATCH] rgw: skip empty http args in method parse() to avoid extra effort Signed-off-by: Guo Zhandong --- src/rgw/rgw_common.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 9aa6f3c4d7d9..36ddf9b5ca46 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -733,7 +733,12 @@ int RGWHTTPArgs::parse() { int pos = 0; bool end = false; - if (str[pos] == '?') pos++; + + if (str.empty()) + return 0; + + if (str[pos] == '?') + pos++; while (!end) { int fpos = str.find('&', pos); -- 2.47.3