Bug 1435923 - Fix truncated logging of remote lookup protocol buffer. r=gcp

Fix the truncate issue when output the protocol buffer

Differential Revision: https://phabricator.services.mozilla.com/D16675

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dimi Lee 2019-01-17 12:38:04 +00:00
Родитель de59370b24
Коммит 6e69465ce8
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -1525,8 +1525,14 @@ nsresult PendingLookup::SendRemoteQueryInternal(Reason& aReason) {
if (!mRequest.SerializeToString(&serialized)) {
return NS_ERROR_UNEXPECTED;
}
LOG(("Serialized protocol buffer [this = %p]: (length=%zu) %s", this,
serialized.length(), serialized.c_str()));
if (LOG_ENABLED()) {
nsAutoCString serializedStr(serialized.c_str(), serialized.length());
serializedStr.ReplaceSubstring(NS_LITERAL_CSTRING("\0"), NS_LITERAL_CSTRING("\\0"));
LOG(("Serialized protocol buffer [this = %p]: (length=%d) %s", this,
serializedStr.Length(), serializedStr.get()));
}
// Set the input stream to the serialized protocol buffer
nsCOMPtr<nsIStringInputStream> sstream =