Browse Source

Merge branch 'master' of github.com:bitcoin/bitcoin

0.8
Gavin Andresen 13 years ago
parent
commit
43d16f0361
  1. 14
      src/main.cpp

14
src/main.cpp

@ -2947,7 +2947,7 @@ bool ProcessMessages(CNode* pfrom)
unsigned int nMessageSize = hdr.nMessageSize; unsigned int nMessageSize = hdr.nMessageSize;
if (nMessageSize > MAX_SIZE) if (nMessageSize > MAX_SIZE)
{ {
printf("ProcessMessage(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize); printf("ProcessMessages(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize);
continue; continue;
} }
if (nMessageSize > vRecv.size()) if (nMessageSize > vRecv.size())
@ -2963,7 +2963,7 @@ bool ProcessMessages(CNode* pfrom)
memcpy(&nChecksum, &hash, sizeof(nChecksum)); memcpy(&nChecksum, &hash, sizeof(nChecksum));
if (nChecksum != hdr.nChecksum) if (nChecksum != hdr.nChecksum)
{ {
printf("ProcessMessage(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n", printf("ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum); strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);
continue; continue;
} }
@ -2988,22 +2988,22 @@ bool ProcessMessages(CNode* pfrom)
if (strstr(e.what(), "end of data")) if (strstr(e.what(), "end of data"))
{ {
// Allow exceptions from underlength message on vRecv // Allow exceptions from underlength message on vRecv
printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what()); printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what());
} }
else if (strstr(e.what(), "size too large")) else if (strstr(e.what(), "size too large"))
{ {
// Allow exceptions from overlong size // Allow exceptions from overlong size
printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what()); printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what());
} }
else else
{ {
PrintExceptionContinue(&e, "ProcessMessage()"); PrintExceptionContinue(&e, "ProcessMessages()");
} }
} }
catch (std::exception& e) { catch (std::exception& e) {
PrintExceptionContinue(&e, "ProcessMessage()"); PrintExceptionContinue(&e, "ProcessMessages()");
} catch (...) { } catch (...) {
PrintExceptionContinue(NULL, "ProcessMessage()"); PrintExceptionContinue(NULL, "ProcessMessages()");
} }
if (!fRet) if (!fRet)

Loading…
Cancel
Save