From: Robin H. Johnson Date: Sun, 15 Dec 2013 19:40:31 +0000 (-0800) Subject: rgw: Clarify naming of case-change functions X-Git-Tag: v0.67.6~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da2267a87e37afa28385e915a566de26fd784b70;p=ceph.git rgw: Clarify naming of case-change functions 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 Reviewed-by: Yehuda Sadeh (cherry picked from commit 6a7edab2673423c53c6a422a10cb65fe07f9b235) --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 30cb0d9b66e5..d3825129fc51 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -62,8 +62,9 @@ static map 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::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; }