Skip to content

Commit

Permalink
Merge pull request ceph#11989 from idealguo/httpargs-parse-cleanup
Browse files Browse the repository at this point in the history
rgw: skip empty http args in method parse() to avoid extra effort
  • Loading branch information
mattbenjamin authored Nov 21, 2016
2 parents f579a3e + 5a1212e commit 7d3d1c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rgw/rgw_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7d3d1c4

Please sign in to comment.