]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Do not assum rest connection to be established
authorChristophe Courtaut <christophe.courtaut@gmail.com>
Fri, 31 May 2013 07:55:27 +0000 (09:55 +0200)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 31 May 2013 16:39:56 +0000 (09:39 -0700)
Added a check to verify that rest connection is correctly initialized,
preventing a segmentation fault.

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_op.cc

index a1b46bcefbdcbe4dc4a7af6f07668d1080d09265..5b737fec653875112f634710014d67141354d408 100644 (file)
@@ -853,6 +853,10 @@ int RGWCreateBucket::verify_permission()
 template<class T>
 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