From 400f9f63d8314b0fdf502d0edabd73fa2fd93f1b Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 11 Mar 2013 20:44:23 +0000 Subject: [PATCH] added/fixed some debug info git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6208 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/ft/ftdatamultiplex.cc | 7 +++++-- libretroshare/src/ft/ftfilecreator.cc | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/ft/ftdatamultiplex.cc b/libretroshare/src/ft/ftdatamultiplex.cc index 3d4cd373a..bcc6c815c 100644 --- a/libretroshare/src/ft/ftdatamultiplex.cc +++ b/libretroshare/src/ft/ftdatamultiplex.cc @@ -811,14 +811,14 @@ bool ftDataMultiplex::handleRecvClientChunkMapRequest(const std::string& peerId, // If we can't find the client, it's not a problem. Chunk maps from // clients are not essential, as they are only used for display. #ifdef MPLEX_DEBUG - std::cerr << "ftDataMultiplex::handleRecvServerChunkMapRequest() ERROR: No matching Client for hash " << hash ; + std::cerr << "ftDataMultiplex::handleRecvClientChunkMapRequest() ERROR: No matching Client for hash " << hash ; std::cerr << ". Performing local search." << std::endl; #endif return false; } #ifdef MPLEX_DEBUG - std::cerr << "ftDataMultiplex::handleRecvServerChunkMapRequest() Sending map of file " << hash << ", to peer " << peerId << std::endl; + std::cerr << "ftDataMultiplex::handleRecvClientChunkMapRequest() Sending map of file " << hash << ", to peer " << peerId << std::endl; #endif (it->second).mCreator->getAvailabilityMap(cmap); @@ -989,7 +989,10 @@ bool ftDataMultiplex::handleRecvServerChunkMapRequest(const std::string& peerId, it = mServers.find(hash) ; if(it == mServers.end()) // handleSearchRequest should have filled mServers[hash], but we have been off-mutex since, + { + std::cerr << "ftDataMultiplex::handleRecvChunkMapReq() : weird state: search request succeeded, but no server available!" << std::endl; return false ; // so it's safer to check again. + } else it->second->getAvailabilityMap(cmap); } diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index 8d9163ce3..739e6cda2 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -573,6 +573,9 @@ void ftFileCreator::setSourceMap(const std::string& peer_id,const CompressedChun { RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/ +#ifdef FILE_DEBUG + std::cerr << "ftFileCreator:: Received source map for hash " << hash << " for source peer " << peer_id << std::endl; +#endif // At this point, we should cancel all file chunks that are asked to the // peer and which this peer actually doesn't possesses. Otherwise, the transfer may get stuck. // This should be done by: