add ifdef for debug logs

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1879 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-12-14 18:10:20 +00:00
parent df5d249dd1
commit 3cac0c1ce9

View File

@ -273,8 +273,10 @@ bool ftController::FlagFileComplete(std::string hash)
RsStackMutex stack2(doneMutex); RsStackMutex stack2(doneMutex);
mDone.push_back(hash); mDone.push_back(hash);
std::cerr << "ftController:FlagFileComplete(" << hash << ")"; #ifdef CONTROL_DEBUG
std::cerr << std::endl; std::cerr << "ftController:FlagFileComplete(" << hash << ")";
std::cerr << std::endl;
#endif
return true; return true;
} }
@ -285,20 +287,20 @@ bool ftController::moveFile(const std::string& source,const std::string& dest)
// //
if (0 == rename(source.c_str(), dest.c_str())) if (0 == rename(source.c_str(), dest.c_str()))
{ {
//#ifdef CONTROL_DEBUG #ifdef CONTROL_DEBUG
std::cerr << "ftController::completeFile() renaming to: "; std::cerr << "ftController::completeFile() renaming to: ";
std::cerr << dest; std::cerr << dest;
std::cerr << std::endl; std::cerr << std::endl;
//#endif #endif
return true ; return true ;
} }
//#ifdef CONTROL_DEBUG #ifdef CONTROL_DEBUG
std::cerr << "ftController::completeFile() FAILED mv to: "; std::cerr << "ftController::completeFile() FAILED mv to: ";
std::cerr << dest; std::cerr << dest;
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << "trying copy" << std::endl ; std::cerr << "trying copy" << std::endl ;
//#endif #endif
// We could not rename, probably because we're dealing with different file systems. // We could not rename, probably because we're dealing with different file systems.
// Let's copy then. // Let's copy then.
@ -756,17 +758,21 @@ bool ftController::FileRequest(std::string fname, std::string hash,
/* if the sources don't exist already - add in */ /* if the sources don't exist already - add in */
for(pit = info.peers.begin(); pit != info.peers.end(); pit++) for(pit = info.peers.begin(); pit != info.peers.end(); pit++)
{ {
std::cerr << "\tSource: " << pit->peerId; #ifdef CONTROL_DEBUG
std::cerr << "\tSource: " << pit->peerId;
std::cerr << std::endl; std::cerr << std::endl;
#endif
if (srcIds.end() == std::find( if (srcIds.end() == std::find(
srcIds.begin(), srcIds.end(), pit->peerId)) srcIds.begin(), srcIds.end(), pit->peerId))
{ {
srcIds.push_back(pit->peerId); srcIds.push_back(pit->peerId);
std::cerr << "\tAdding in: " << pit->peerId; #ifdef CONTROL_DEBUG
std::cerr << "\tAdding in: " << pit->peerId;
std::cerr << std::endl; std::cerr << std::endl;
} #endif
}
} }
} }