log low-level network messages only when fDebug is set

This commit is contained in:
Nils Schneider
2011-09-17 18:29:41 +02:00
parent 217208a36d
commit 59090133c0
2 changed files with 12 additions and 7 deletions

View File

@@ -282,9 +282,10 @@ public:
nHeaderStart = vSend.size();
vSend << CMessageHeader(pszCommand, 0);
nMessageStart = vSend.size();
if (fDebug)
if (fDebug) {
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("sending: %s ", pszCommand);
printf("sending: %s ", pszCommand);
}
}
void AbortMessage()
@@ -324,8 +325,10 @@ public:
memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum));
}
printf("(%d bytes) ", nSize);
printf("\n");
if (fDebug) {
printf("(%d bytes) ", nSize);
printf("\n");
}
nHeaderStart = -1;
nMessageStart = -1;