- more logging to track down cold's issue

This commit is contained in:
Mark Vejvoda 2012-07-06 21:28:54 +00:00
parent 2572fcf561
commit eee0d0ab2e
2 changed files with 8 additions and 1 deletions

View File

@ -41,6 +41,9 @@ bool NetworkMessage::receive(Socket* socket, void* data, int dataSize, bool tryR
if(socket != NULL) {
int dataReceived = socket->receive(data, dataSize, tryReceiveUntilDataSizeMet);
if(dataReceived != dataSize) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING, dataReceived = %d dataSize = %d\n",__FILE__,__FUNCTION__,__LINE__,dataReceived,dataSize);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nIn [%s::%s Line: %d] WARNING, dataReceived = %d dataSize = %d\n",__FILE__,__FUNCTION__,__LINE__,dataReceived,dataSize);
if(socket != NULL && socket->getSocketId() > 0) {
throw megaglest_runtime_error("Error receiving NetworkMessage, dataReceived = " + intToStr(dataReceived) + ", dataSize = " + intToStr(dataSize));
}

View File

@ -265,10 +265,11 @@ int32 Checksum::getSum() {
Checksum newResult;
{
MutexSafeWrapper safeMutexSocketDestructorFlag(&Checksum::fileListCacheSynchAccessor,string(__FILE__) + "_" + intToStr(__LINE__));
for(std::map<string,int32>::iterator iterMap = fileList.begin();
iterMap != fileList.end(); ++iterMap) {
MutexSafeWrapper safeMutexSocketDestructorFlag(&Checksum::fileListCacheSynchAccessor,string(__FILE__) + "_" + intToStr(__LINE__));
if(Checksum::fileListCache.find(iterMap->first) == Checksum::fileListCache.end()) {
Checksum fileResult;
bool fileAddedOk = fileResult.addFileToSum(iterMap->first);
@ -281,6 +282,9 @@ int32 Checksum::getSum() {
newResult.addSum(Checksum::fileListCache[iterMap->first]);
}
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileList.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,fileList.size());
return newResult.getSum();
}
return sum;