Add session_id to mtproto logs.

This commit is contained in:
John Preston 2025-07-08 21:32:15 +04:00
parent 1c53fca925
commit 8e9630459b

View file

@ -1388,9 +1388,10 @@ void SessionPrivate::handleReceived() {
auto sfrom = decryptedInts + 4U; // msg_id + seq_no + length + message
MTP_LOG(_shiftedDcId, ("Recv: ")
+ DumpToText(sfrom, end)
+ QString(" (dc:%1,key:%2)"
+ QString(" (dc:%1,key:%2,session:%3)"
).arg(AbstractConnection::ProtocolDcDebugId(getProtocolDcId())
).arg(_encryptionKey->keyId()));
).arg(_encryptionKey->keyId()
).arg(_sessionId));
const auto registered = _receivedMessageIds.registerMsgId(
msgId,
@ -2663,9 +2664,10 @@ bool SessionPrivate::sendSecureRequest(
auto from = request->constData() + 4;
MTP_LOG(_shiftedDcId, ("Send: ")
+ DumpToText(from, from + messageSize)
+ QString(" (dc:%1,key:%2)"
+ QString(" (dc:%1,key:%2,session:%3)"
).arg(AbstractConnection::ProtocolDcDebugId(getProtocolDcId())
).arg(_encryptionKey->keyId()));
).arg(_encryptionKey->keyId()
).arg(_sessionId));
uchar encryptedSHA256[32];
MTPint128 &msgKey(*(MTPint128*)(encryptedSHA256 + 8));