From: Enming Zhang Date: Fri, 7 Jul 2017 10:05:17 +0000 (+0800) Subject: rgw: req xml params size limitation error msg X-Git-Tag: ses5-milestone9~1^2~10^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eb752e0b8d5a6c10726c9e430d348b3a5df81fa4;p=ceph.git rgw: req xml params size limitation error msg Now rgw will return like following: 400 MalformedXMLThe XML you provided was larger than the maximum 2048 bytes allowed.333tx000000000000000000009-00596a1331-101a-default101a-default-default Signed-off-by: Enming Zhang --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 20eada8ed19..630f3f4806b 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -4537,8 +4537,17 @@ void RGWPutACLs::execute() owner = existing_policy->get_owner(); op_ret = get_params(); - if (op_ret < 0) + if (op_ret < 0) { + if (op_ret == -ERANGE) { + ldout(s->cct, 4) << "The size of request xml data is larger than the max limitation, data size = " + << s->length << dendl; + op_ret = -ERR_MALFORMED_XML; + s->err.message = "The XML you provided was larger than the maximum " + + std::to_string(s->cct->_conf->rgw_max_put_param_size) + + " bytes allowed."; + } return; + } ldout(s->cct, 15) << "read len=" << len << " data=" << (data ? data : "") << dendl;