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

Fix mixer client crash. #136

Merged
merged 3 commits into from
Mar 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/envoy/mixer/http_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ void FillRequestHeaderAttributes(const HeaderMap& header_map,
StringMapValue(ExtractHeaders(header_map));
}

void FillResponseHeaderAttributes(const HeaderMap& header_map,
void FillResponseHeaderAttributes(const HeaderMap* header_map,
Attributes* attr) {
attr->attributes[kResponseHeaders] =
StringMapValue(ExtractHeaders(header_map));
if (header_map) {
attr->attributes[kResponseHeaders] =
StringMapValue(ExtractHeaders(*header_map));
}
attr->attributes[kResponseTime] = TimeValue(std::chrono::system_clock::now());
}

Expand Down Expand Up @@ -180,7 +182,7 @@ void HttpControl::Report(HttpRequestDataPtr request_data,
int check_status, DoneFunc on_done) {
// Use all Check attributes for Report.
// Add additional Report attributes.
FillResponseHeaderAttributes(*response_headers, &request_data->attributes);
FillResponseHeaderAttributes(response_headers, &request_data->attributes);
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, in what situation response_headers will be nullptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GET

Copy link
Contributor

Choose a reason for hiding this comment

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

hm, weird. GET should have response_headers as well..


FillRequestInfoAttributes(request_info, check_status,
&request_data->attributes);
Expand Down