]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix calls to finish_get_obj() with uninitialized handle
authorYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 21 Jul 2010 18:03:03 +0000 (11:03 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 21 Jul 2010 18:03:36 +0000 (11:03 -0700)
src/rgw/rgw_op.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_user.cc

index f50729d61dffedbc580846c1010a1f820f2e19c9..0edad78ecc46f088a4cb8c9bb0e0e5405cc9e91a 100644 (file)
@@ -128,7 +128,7 @@ int read_acls(struct req_state *s, bool only_bucket)
 
 void RGWGetObj::execute()
 {
-  void *handle;
+  void *handle = NULL;
 
   if (!verify_permission(s, RGW_PERM_READ)) {
     ret = -EACCES;
@@ -140,32 +140,24 @@ void RGWGetObj::execute()
     goto done;
 
   init_common();
-cout << __func__ << ":" << __LINE__ << ": ofs=" << ofs << std::endl;
+
   ret = rgwstore->prepare_get_obj(s->bucket_str, s->object_str, ofs, &end, &attrs, mod_ptr,
                                   unmod_ptr, if_match, if_nomatch, &total_len, &handle, &err);
   if (ret < 0)
     goto done;
 
-cout << __func__ << ":" << __LINE__ << ": ofs=" << ofs << std::endl;
-
   if (!get_data || ofs > end)
     goto done;
 
   while (ofs <= end) {
-cout << __func__ << ":" << __LINE__ << ": ofs=" << ofs << std::endl;
-
-cout << "RGWGetObj::execute():" << __LINE__ << ": len=" << len << std::endl;
     len = rgwstore->get_obj(&handle, s->bucket_str, s->object_str, &data, ofs, end);
     if (len < 0) {
       ret = len;
       goto done;
     }
-cout << "RGWGetObj::execute():" << __LINE__ << ": len=" << len << std::endl;
 
-cout << __func__ << ":" << __LINE__ << ": ofs=" << ofs << std::endl;
     ofs += len;
     send_response(handle);
-cout << "RGWGetObj::execute():" << __LINE__ << ": len=" << len << std::endl;
     free(data);
   }
 
index 14bbbbd461ba4de52144d2bc6586ac0dff6ef8eb..257e3118d4b8c098e5d80ba7de7f2bf3870354ae 100644 (file)
@@ -348,7 +348,7 @@ int RGWRados::copy_obj(std::string& id, std::string& dest_bucket, std::string& d
 
   cerr << "copy " << src_bucket << ":" << src_obj << " => " << dest_bucket << ":" << dest_obj << std::endl;
 
-  void *handle;
+  void *handle = NULL;
 
   map<string, bufferlist> attrset;
   ret = prepare_get_obj(src_bucket, src_obj, ofs, &end, &attrset,
index 2db5b5f4af08bf463a17f6d37289d828ad7f4495..2a1c4404b729f415d8f23db7c5dc86efe518f1a4 100644 (file)
@@ -25,7 +25,7 @@ int rgw_get_user_info(string user_id, RGWUserInfo& info)
   int ret;
   char *data;
   struct rgw_err err;
-  void *handle;
+  void *handle = NULL;
   off_t ofs = 0, end = -1;
   size_t total_len;
   bufferlist::iterator iter;
@@ -115,7 +115,7 @@ int rgw_get_uid_by_email(string& email, string& user_id)
   char *data;
   struct rgw_err err;
   RGWUID uid;
-  void *handle;
+  void *handle = NULL;
   off_t ofs = 0, end = -1;
   bufferlist::iterator iter;
   size_t total_len;