From: Christophe Courtaut Date: Fri, 31 May 2013 07:55:27 +0000 (+0200) Subject: rgw: Do not assum rest connection to be established X-Git-Tag: v0.67-rc1~128^2~92 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8f3f0537f2164f563e154c988f59b25d3be70014;p=ceph.git rgw: Do not assum rest connection to be established Added a check to verify that rest connection is correctly initialized, preventing a segmentation fault. Signed-off-by: Christophe Courtaut Reviewed-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a1b46bcefbd..5b737fec653 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -853,6 +853,10 @@ int RGWCreateBucket::verify_permission() template static int forward_request(struct req_state *s, RGWRados *store, bufferlist& in_data, const char *name, T& obj) { + if (!store->rest_conn) { + ldout(s->cct, 0) << "rest connection is invalid" << dendl; + return -EINVAL; + } ldout(s->cct, 0) << "sending create_bucket request to master region" << dendl; bufferlist response; #define MAX_REST_RESPONSE (128 * 1024) // we expect a very small response