From 4c798752c6d2805e74464588cae1d67da69e8a4a Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 9 Jun 2011 17:03:23 -0700 Subject: [PATCH] rgw: can specify alternative remote addr http header param --- src/rgw/rgw_log.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index 25fdf7daa9b76..21f6e92d7db52 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -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); -- 2.39.5