]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: free components on shutdown
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 9 Mar 2016 16:21:55 +0000 (11:21 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Sat, 12 Mar 2016 21:02:58 +0000 (13:02 -0800)
Also, use ldout in rgw_file.h in 3 places.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/librgw.cc
src/rgw/rgw_file.h
src/rgw/rgw_rest_s3.cc
src/test/Makefile-client.am

index 7e6a5fd81e3e6f702a94156722a31dbeda4faf3b..4e71ee8659315f41f6436cba8d98c085eb31d431 100644 (file)
@@ -512,6 +512,8 @@ namespace rgw {
     fe->join();
 
     delete fe;
+    delete fec;
+    delete ldh;
 
     rgw_log_usage_finalize();
 
index d7bda12f1d2d4c9e44a9b23c1fadf34647c6ec38..c5751b947dafdcb0668736ad4843fbadb568129a 100644 (file)
@@ -674,7 +674,7 @@ namespace rgw {
          return -ERR_USER_SUSPENDED;
       } else {
        /* try external authenticators (ldap for now) */
-       rgw::LDAPHelper* ldh = rgwlib.get_ldh();
+       rgw::LDAPHelper* ldh = rgwlib.get_ldh(); /* !nullptr */
        RGWToken token{from_base64(key.id)};
        if (ldh->auth(token.id, token.key) == 0) {
          /* try to store user if it doesn't already exist */
@@ -682,8 +682,9 @@ namespace rgw {
            int ret = rgw_store_user_info(store, user, NULL, NULL, 0,
                                          true);
            if (ret < 0) {
-             dout(10) << "NOTICE: failed to store new user's info: ret=" << ret
-                      << dendl;
+             lsubdout(get_context(), rgw, 10)
+               << "NOTICE: failed to store new user's info: ret=" << ret
+               << dendl;
            }
          }
        } /* auth success */
index abf84b2e86ee9ba77f643514a8f220b370ccd644..ceb379b4c0e891a7ae87c46cefe95761afaecb5c 100644 (file)
@@ -1464,8 +1464,9 @@ int RGWPostObj_ObjStore_S3::get_policy()
        if (rgw_get_user_info_by_uid(store, uid, user_info) < 0) {
          int ret = rgw_store_user_info(store, user_info, NULL, NULL, 0, true);
          if (ret < 0) {
-           dout(10) << "NOTICE: failed to store new user's info: ret="
-                    << ret << dendl;
+           ldout(store->ctx(), 10)
+             << "NOTICE: failed to store new user's info: ret="
+             << ret << dendl;
          }
          s->perm_mask = RGW_PERM_FULL_CONTROL;
        }
@@ -1485,8 +1486,9 @@ int RGWPostObj_ObjStore_S3::get_policy()
                                        user_info) < 0) {
          int ret = rgw_store_user_info(store, user_info, NULL, NULL, 0, true);
          if (ret < 0) {
-           dout(10) << "NOTICE: failed to store new user's info: ret=" << ret
-                    << dendl;
+           ldout(store->ctx(), 10)
+             << "NOTICE: failed to store new user's info: ret=" << ret
+             << dendl;
          }
          s->perm_mask = RGW_PERM_FULL_CONTROL;
        }
index b4cb16b580c3bcfa2e7f99d6fdb0aaec35d17175..9ab749816762d99955f4d7ae60dc718f07af2e60 100644 (file)
@@ -751,7 +751,7 @@ test_rgw_ldap_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 test_rgw_ldap_LDADD = $(UNITTEST_LDADD) \
        librados.la $(PTHREAD_LIBS) $(LIBOS) $(CEPH_GLOBAL) ${OPENLDAP_LIBS}
        $(EXTRALIBS)
-bin_DEBUGPROGRAMS += test_rgw_token
+bin_DEBUGPROGRAMS += test_rgw_ldap
 
 endif # WITH_RADOSGW