]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: can specify alternative remote addr http header param
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 10 Jun 2011 00:03:23 +0000 (17:03 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 10 Jun 2011 00:03:23 +0000 (17:03 -0700)
src/rgw/rgw_log.cc

index 25fdf7daa9b7680b5944abcf01e7b8da354dbed4..21f6e92d7db5212849aab2cbe45bec85a901f85c 100644 (file)
@@ -35,7 +35,14 @@ int rgw_log_op(struct req_state *s)
 
   entry.obj_size = s->obj_size;
 
-  set_param_str(s, "REMOTE_ADDR", entry.remote_addr);
+  string remote_param;
+
+  set_param_str(s, "RGW_REMOTE_ADDR_PARAM", remote_param);
+
+  if (remote_param.empty())
+    remote_param = "REMOTE_ADDR";
+
+  set_param_str(s, remote_param.c_str(), entry.remote_addr);
   set_param_str(s, "HTTP_USER_AGENT", entry.user_agent);
   set_param_str(s, "HTTP_REFERRER", entry.referrer);
   set_param_str(s, "REQUEST_URI", entry.uri);