|
|
@ -327,8 +327,10 @@ std::string StatusToString(const absl::Status& status) { |
|
|
|
absl::CHexEscape(payload_view), "\"")); |
|
|
|
absl::CHexEscape(payload_view), "\"")); |
|
|
|
} else if (absl::StartsWith(type_url, kTypeTimeTag)) { |
|
|
|
} else if (absl::StartsWith(type_url, kTypeTimeTag)) { |
|
|
|
type_url.remove_prefix(kTypeTimeTag.size()); |
|
|
|
type_url.remove_prefix(kTypeTimeTag.size()); |
|
|
|
absl::Time t = |
|
|
|
// copy the content before casting to avoid misaligned address access
|
|
|
|
*reinterpret_cast<const absl::Time*>(payload_view.data()); |
|
|
|
alignas(absl::Time) char buf[sizeof(const absl::Time)]; |
|
|
|
|
|
|
|
memcpy(buf, payload_view.data(), sizeof(const absl::Time)); |
|
|
|
|
|
|
|
absl::Time t = *reinterpret_cast<const absl::Time*>(buf); |
|
|
|
kvs.push_back(absl::StrCat(type_url, ":\"", absl::FormatTime(t), "\"")); |
|
|
|
kvs.push_back(absl::StrCat(type_url, ":\"", absl::FormatTime(t), "\"")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
kvs.push_back(absl::StrCat(type_url, ":\"", |
|
|
|
kvs.push_back(absl::StrCat(type_url, ":\"", |
|
|
|