Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: fix opslog cannot record remote_addr #16860

Merged
merged 1 commit into from Aug 29, 2017
Merged

Conversation

mikulely
Copy link
Contributor

@mikulely mikulely commented Aug 7, 2017

@mikulely
Copy link
Contributor Author

mikulely commented Aug 7, 2017

Jenkins, retest this please.

@@ -120,6 +120,10 @@ void RGWCivetWeb::init_env(CephContext *cct)
env.set("REMOTE_USER", info->remote_user);
}

if (info->remote_addr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to check the string length too ?

strlen(info->remote_addr) != 0
or
if(info->remote_addr[0] != '\0')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if remote_add is empty, it's still fine(ops log entry default value is empty string), I'm fine with adding length check here, the concern is if we've introduced the length check, should we also do this for info->remote_user?

So in order to keep consistency with surrounding code, I'd prefer we don't add length check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikulely agree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikulely Agreed with your point. But I don't think there is a possibility of if (info->remote_addr) would take a false branch. Check struct mg_request_info{};.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joscollin Agree, dropped.

@mattbenjamin mattbenjamin self-assigned this Aug 7, 2017
@joscollin joscollin changed the title rgw: fix opslog can not record remote_addr rgw: fix opslog cannot record remote_addr Aug 8, 2017
@mikulely
Copy link
Contributor Author

mikulely commented Aug 8, 2017

Jenkins, retest this please.

@mikulely
Copy link
Contributor Author

mikulely commented Aug 8, 2017

Jenkins, retest this please.

Fixes: http://tracker.ceph.com/issues/20931

Reported-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
@joscollin
Copy link
Member

Jenkins, retest this please.

@joscollin
Copy link
Member

Jenkins, retest this please.

1 similar comment
@joscollin
Copy link
Member

Jenkins, retest this please.

@joscollin
Copy link
Member

Jenkins retest this please

@yehudasa yehudasa merged commit c40f645 into ceph:master Aug 29, 2017
@mikulely mikulely deleted the fix-opslog branch August 30, 2017 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants