]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Clarify naming of case-change functions
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 15 Dec 2013 19:40:31 +0000 (11:40 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 28 Jan 2014 20:52:49 +0000 (12:52 -0800)
It is not clear that the lowercase_http_attr & uppercase_http_attr
functions replace dashes with underscores. Rename them to match the
pattern established by the camelcase_dash_http_attr function in
preperation for more case-change functions as needed by later fixes.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 6a7edab2673423c53c6a422a10cb65fe07f9b235)

src/rgw/rgw_rest.cc

index 30cb0d9b66e5e857a4b593a55ea7a1a9f8b4c314..d3825129fc51464b35ee0a8b96d3f88d99230e73 100644 (file)
@@ -62,8 +62,9 @@ static map<string, string> generic_attrs_map;
 
 /*
  * make attrs look_like_this
+ * converts dashes to underscores
  */
-string lowercase_http_attr(const string& orig)
+string lowercase_underscore_http_attr(const string& orig)
 {
   const char *s = orig.c_str();
   char buf[orig.size() + 1];
@@ -83,8 +84,9 @@ string lowercase_http_attr(const string& orig)
 
 /*
  * make attrs LOOK_LIKE_THIS
+ * converts dashes to underscores
  */
-string uppercase_http_attr(const string& orig)
+string uppercase_underscore_http_attr(const string& orig)
 {
   const char *s = orig.c_str();
   char buf[orig.size() + 1];
@@ -104,6 +106,7 @@ string uppercase_http_attr(const string& orig)
 
 /*
  * make attrs Look-Like-This
+ * converts underscores to dashes
  */
 string camelcase_dash_http_attr(const string& orig)
 {
@@ -146,12 +149,12 @@ void rgw_rest_init(CephContext *cct)
   list<string>::iterator iter;
   for (iter = extended_http_attrs.begin(); iter != extended_http_attrs.end(); ++iter) {
     string rgw_attr = RGW_ATTR_PREFIX;
-    rgw_attr.append(lowercase_http_attr(*iter));
+    rgw_attr.append(lowercase_underscore_http_attr(*iter));
 
     rgw_to_http_attrs[rgw_attr] = camelcase_dash_http_attr(*iter);
 
     string http_header = "HTTP_";
-    http_header.append(uppercase_http_attr(*iter));
+    http_header.append(uppercase_underscore_http_attr(*iter));
 
     generic_attrs_map[http_header] = rgw_attr;
   }