From: Yehuda Sadeh Date: Mon, 15 Feb 2016 22:51:32 +0000 (-0800) Subject: rgw: don't try to parse some forwarded requests X-Git-Tag: v10.1.0~354^2~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c28f198977a910ab3b66568e1c2187128d05115;p=ceph.git rgw: don't try to parse some forwarded requests Not every forwarded requests are expected to get a json response, don't pass the parser when not needed. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index aa9b00545d7..12cf50567a7 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1718,7 +1718,7 @@ static int forward_request_to_master(struct req_state *s, obj_version *objv, RGW return ret; ldout(s->cct, 20) << "response: " << response.c_str() << dendl; - if (!jp->parse(response.c_str(), response.length())) { + if (jp && !jp->parse(response.c_str(), response.length())) { ldout(s->cct, 0) << "failed parsing response from master zonegroup" << dendl; return -EINVAL; } @@ -1934,9 +1934,8 @@ void RGWDeleteBucket::execute() if (!store->is_meta_master()) { bufferlist in_data; - JSONParser jp; op_ret = forward_request_to_master(s, &ot.read_version, store, in_data, - &jp); + NULL); if (op_ret < 0) { if (op_ret == -ENOENT) { /* adjust error, we want to return with NoSuchBucket and not @@ -4350,9 +4349,8 @@ bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path) if (!store->get_zonegroup().is_master) { bufferlist in_data; - JSONParser jp; ret = forward_request_to_master(s, &ot.read_version, store, in_data, - &jp); + NULL); if (ret < 0) { if (ret == -ENOENT) { /* adjust error, we want to return with NoSuchBucket and not