]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: remove deprecated librgw methods
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 27 Jan 2016 03:20:08 +0000 (22:20 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:08:13 +0000 (12:08 -0500)
Remove unused routines:

 * librgw_acl_bin2xml
 * librgw_free_xml
 * librgw_acl_xml2bin
 * librgw_free_bin(librgw_t rgw, char* bin)

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/librgw.cc

index 93a357868085972b5c69276a2baa194ebfd957b5..1b706752bdd9e16a7483b7db71a7a17715c89148 100644 (file)
@@ -586,92 +586,6 @@ int librgw_create(librgw_t* rgw, int argc, char **argv)
   return 0;
 }
 
-int librgw_acl_bin2xml(librgw_t rgw, const char* bin, int bin_len, char** xml)
-{
-  CephContext* cct = static_cast<CephContext*>(rgw);
-  try {
-    // convert to bufferlist
-    bufferlist bl;
-    bl.append(bin, bin_len);
-
-    // convert to RGWAccessControlPolicy
-    RGWAccessControlPolicy_S3 acl(cct);
-    bufferlist::iterator bli(bl.begin());
-    acl.decode(bli);
-
-    // convert to XML stringstream
-    stringstream ss;
-    acl.to_xml(ss);
-
-    // convert to XML C string
-    *xml = strdup(ss.str().c_str());
-    if (!*xml)
-      return -ENOBUFS;
-    return 0;
-  }
-  catch (const std::exception& e) {
-    lderr(cct) << "librgw_acl_bin2xml: caught exception " << e.what() << dendl;
-    return -2000;
-  }
-  catch (...) {
-    lderr(cct) << "librgw_acl_bin2xml: caught unknown exception " << dendl;
-    return -2000;
-  }
-}
-
-void librgw_free_xml(librgw_t rgw, char *xml)
-{
-  free(xml);
-}
-
-int librgw_acl_xml2bin(librgw_t rgw, const char* xml, char** bin, int* bin_len)
-{
-  CephContext* cct = static_cast<CephContext*>(rgw);
-  char *bin_ = NULL;
-  try {
-    RGWACLXMLParser_S3 parser(cct);
-    if (!parser.init()) {
-      return -1000;
-    }
-    if (!parser.parse(xml, strlen(xml), true)) {
-      return -EINVAL;
-    }
-    RGWAccessControlPolicy_S3* policy =
-      (RGWAccessControlPolicy_S3*)parser.find_first("AccessControlPolicy");
-    if (!policy) {
-      return -1001;
-    }
-    bufferlist bl;
-    policy->encode(bl);
-
-    bin_ = (char*)malloc(bl.length());
-    if (!bin_) {
-      return -ENOBUFS;
-    }
-    int bin_len_ = bl.length();
-    bl.copy(0, bin_len_, bin_);
-
-    *bin = bin_;
-    *bin_len = bin_len_;
-    return 0;
-  }
-  catch (const std::exception& e) {
-    lderr(cct) << "librgw_acl_bin2xml: caught exception " << e.what() << dendl;
-  }
-  catch (...) {
-    lderr(cct) << "librgw_acl_bin2xml: caught unknown exception " << dendl;
-  }
-  if (!bin_)
-    free(bin_);
-  bin_ = NULL;
-  return -2000;
-}
-
-void librgw_free_bin(librgw_t rgw, char* bin)
-{
-  free(bin);
-}
-
 void librgw_shutdown(librgw_t rgw)
 {
   using namespace rgw;