diff --git a/TODO.txt b/TODO.txt index edc2a2bcd..b42f8810f 100644 --- a/TODO.txt +++ b/TODO.txt @@ -41,9 +41,12 @@ E [X] addFriend does not work when the cert contains signatures. E [X] PGP signatures are not transmited by discovery2. [X] Default appearance style on Ubuntu should be GTK (to allow correct tooltips) [X] Default layout should use toolbars. The "menu" look is inneficient + [ ] replace sound tooltip "sound off" by "sound is on, click to turn off" Messages H [X] distant messages should be made async-ed + * [ ] increase sigma of activity events to allow a more generous routing matrix + * [ ] collect routing events from chat lobbies? (maybe not a good idea) M [X] distant messages are not re-sent when the peer is offline the first time M [X] sent messages to direct peers in the Sent box have inconsistent To field. Raises an error if you click on it. @@ -60,6 +63,7 @@ H [X] marking all as read in channels takes time. The channel icon should [X] allow to post on channels when attachment is not in shared files. Just display a warning. M [ ] popularity calculation seems wrong. To reproduce: create a new channel and subscribe to it from another location with many friends => popularity is too big at that location (should be 1) + [ ] show group owner in channel/forum/posted's details tab Chat lobbies H [X] Chat lobbies should use Identities. That's a significant change, probably not backward compatible. @@ -120,7 +124,7 @@ H [ ] RsGxsDataAccess::processRequests locks mDataMutex until all request Packaging [X] check compilation on debian [X] check compilation on ARM - [ ] Sound files should be part of the install package + [ ] Sound files should be part of the install package at least on ubuntu (put them in /usr/share) Post v0.6 release changes ========================= diff --git a/libbitdht/src/bitdht/bdmanager.cc b/libbitdht/src/bitdht/bdmanager.cc index a0ae4a912..f56722a6a 100644 --- a/libbitdht/src/bitdht/bdmanager.cc +++ b/libbitdht/src/bitdht/bdmanager.cc @@ -588,9 +588,11 @@ void bdNodeManager::SearchForLocalNet() { if (it->second.mQFlags & BITDHT_QFLAGS_INTERNAL) { - std::cerr << "bdNodeManager::SearchForLocalNet() Existing Internal Search: "; +#ifdef DEBUG_MGR + std::cerr << "bdNodeManager::SearchForLocalNet() Existing Internal Search: "; mFns->bdPrintNodeId(std::cerr, &(it->first)); - std::cerr << std::endl; + std::cerr << std::endl; +#endif numSearchQueries++; } diff --git a/libretroshare/src/dbase/findex.cc b/libretroshare/src/dbase/findex.cc index edf50d52c..ca217824b 100644 --- a/libretroshare/src/dbase/findex.cc +++ b/libretroshare/src/dbase/findex.cc @@ -1045,8 +1045,9 @@ int FileIndex::saveIndex(const std::string& filename, RsFileHash &fileHash, uint s += "-\n"; // now compress the data. - - std::cerr << "FileIndex::saveIndex(): compressign data." << std::endl; +#ifdef FI_DEBUG + std::cerr << "FileIndex::saveIndex(): compressign data." << std::endl; +#endif uint8_t *compressed_data = NULL ; uint32_t compressed_data_size = 0 ; @@ -1059,10 +1060,12 @@ int FileIndex::saveIndex(const std::string& filename, RsFileHash &fileHash, uint fileHash = RsDirUtil::sha1sum((unsigned char *)compressed_data,compressed_data_size); - std::cerr << " file = " << filename << std::endl; +#ifdef FI_DEBUG + std::cerr << " file = " << filename << std::endl; std::cerr << " old size = " << s.length() << std::endl; std::cerr << " new size = " << compressed_data_size << std::endl; - std::cerr << " hash = " << fileHash << std::endl; + std::cerr << " hash = " << fileHash << std::endl; +#endif // /* calculate sha1 hash */ // SHA_CTX *sha_ctx = new SHA_CTX; diff --git a/libretroshare/src/dht/p3bitdht_peers.cc b/libretroshare/src/dht/p3bitdht_peers.cc index 233a77c9c..fc16a7a8f 100644 --- a/libretroshare/src/dht/p3bitdht_peers.cc +++ b/libretroshare/src/dht/p3bitdht_peers.cc @@ -221,9 +221,12 @@ int p3BitDht::addKnownPeer(const RsPeerId &pid, const struct sockaddr_storage &a struct sockaddr_in addrv4; if (addr.ss_family != AF_INET) - { - std::cerr << "p3BitDht::addKnownPeer() Warning! Non IPv4 Address - Cannot handle IPV6 Yet. addr.ss_family=" << addr.ss_family; - std::cerr << std::endl; + { + if(addr.ss_family != AF_UNSPEC) + { + std::cerr << "p3BitDht::addKnownPeer() Warning! Non IPv4 Address - Cannot handle IPV6 Yet. addr.ss_family=" << addr.ss_family; + std::cerr << std::endl; + } sockaddr_clear(&addrv4); if (flags & NETASSIST_KNOWN_PEER_ONLINE) diff --git a/libretroshare/src/grouter/groutermatrix.cc b/libretroshare/src/grouter/groutermatrix.cc index b96b80a0c..1401f6a6c 100644 --- a/libretroshare/src/grouter/groutermatrix.cc +++ b/libretroshare/src/grouter/groutermatrix.cc @@ -27,6 +27,8 @@ #include "groutermatrix.h" #include "grouteritems.h" +//#define ROUTING_MATRIX_DEBUG + GRouterMatrix::GRouterMatrix() { _proba_need_updating = true ; @@ -72,7 +74,9 @@ bool GRouterMatrix::addRoutingClue(const GRouterKeyId& key_id,const RsPeerId& so for(uint32_t i=RS_GROUTER_MATRIX_MAX_HIT_ENTRIES;i& w(it2->second) ; @@ -203,7 +211,9 @@ bool GRouterMatrix::updateRoutingProbabilities() for(std::map >::const_iterator it(_routing_clues.begin());it!=_routing_clues.end();++it) { - std::cerr << " " << it->first.toStdString() << " : " ; +#ifdef ROUTING_MATRIX_DEBUG + std::cerr << " " << it->first.toStdString() << " : " ; +#endif std::vector& v(_time_combined_hits[it->first]) ; v.clear() ; @@ -216,8 +226,10 @@ bool GRouterMatrix::updateRoutingProbabilities() float time_difference_in_days = 1 + (now - (*it2).time_stamp ) / (7*86400.0f) ; v[(*it2).friend_id] += (*it2).weight / (time_difference_in_days*time_difference_in_days) ; } - } - std::cerr << " done." << std::endl; + } +#ifdef ROUTING_MATRIX_DEBUG + std::cerr << " done." << std::endl; +#endif _proba_need_updating = false ; return true ; @@ -225,7 +237,9 @@ bool GRouterMatrix::updateRoutingProbabilities() bool GRouterMatrix::saveList(std::list& items) { - std::cerr << " GRoutingMatrix::saveList()" << std::endl; +#ifdef ROUTING_MATRIX_DEBUG + std::cerr << " GRoutingMatrix::saveList()" << std::endl; +#endif RsGRouterMatrixFriendListItem *item = new RsGRouterMatrixFriendListItem ; @@ -249,13 +263,17 @@ bool GRouterMatrix::loadList(std::list& items) RsGRouterMatrixFriendListItem *itm1 = NULL ; RsGRouterMatrixCluesItem *itm2 = NULL ; - std::cerr << " GRoutingMatrix::loadList()" << std::endl; +#ifdef ROUTING_MATRIX_DEBUG + std::cerr << " GRoutingMatrix::loadList()" << std::endl; +#endif for(std::list::const_iterator it(items.begin());it!=items.end();++it) { if(NULL != (itm2 = dynamic_cast(*it))) { - std::cerr << " initing routing clues." << std::endl; +#ifdef ROUTING_MATRIX_DEBUG + std::cerr << " initing routing clues." << std::endl; +#endif _routing_clues[itm2->destination_key] = itm2->clues ; _proba_need_updating = true ; // notifies to re-compute all the info. diff --git a/libretroshare/src/pqi/p3servicecontrol.cc b/libretroshare/src/pqi/p3servicecontrol.cc index 0cdeb0a0e..f8e0687c1 100644 --- a/libretroshare/src/pqi/p3servicecontrol.cc +++ b/libretroshare/src/pqi/p3servicecontrol.cc @@ -428,10 +428,9 @@ bool p3ServiceControl::updateServicesProvided(const RsPeerId &peerId, const RsPe #ifdef SERVICECONTROL_DEBUG std::cerr << "p3ServiceControl::updateServicesProvided() from: " << peerId.toStdString(); std::cerr << std::endl; -#endif - std::cerr << info; std::cerr << std::endl; +#endif mServicesProvided[peerId] = info; updateFilterByPeer_locked(peerId); diff --git a/libretroshare/src/pqi/pqisslpersongrp.cc b/libretroshare/src/pqi/pqisslpersongrp.cc index 18d7c752d..5319a6c6b 100644 --- a/libretroshare/src/pqi/pqisslpersongrp.cc +++ b/libretroshare/src/pqi/pqisslpersongrp.cc @@ -42,6 +42,7 @@ const int pqipersongrpzone = 354; #include "pqi/pqissllistener.h" #include "pqi/p3peermgr.h" +//#define PQISSLPERSON_DEBUG #ifndef PQI_DISABLE_UDP #include "pqi/pqissludp.h" @@ -57,8 +58,10 @@ pqilistener * pqisslpersongrp::locked_createListener(const struct sockaddr_stora pqiperson * pqisslpersongrp::locked_createPerson(const RsPeerId& id, pqilistener *listener) { +#ifdef PQISSLPERSON_DEBUG std::cerr << "pqisslpersongrp::locked_createPerson() PeerId: " << id; - std::cerr << std::endl; + std::cerr << std::endl; +#endif pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrp::createPerson() PeerId: " + id.toStdString()); @@ -68,8 +71,10 @@ pqiperson * pqisslpersongrp::locked_createPerson(const RsPeerId& id, pqilistener // If we are a hidden node - then all connections should be via proxy. if (mPeerMgr->isHiddenPeer(id) || mPeerMgr->isHidden()) { - std::cerr << "pqisslpersongrp::locked_createPerson() Is Hidden Peer!"; - std::cerr << std::endl; +#ifdef PQISTREAMER_DEBUG + std::cerr << "pqisslpersongrp::locked_createPerson() Is Hidden Peer!"; + std::cerr << std::endl; +#endif pqisslproxy *pqis = new pqisslproxy((pqissllistener *) listener, pqip, mLinkMgr); @@ -90,8 +95,10 @@ pqiperson * pqisslpersongrp::locked_createPerson(const RsPeerId& id, pqilistener } else { - std::cerr << "pqisslpersongrp::locked_createPerson() Is Normal Peer!"; - std::cerr << std::endl; +#ifdef PQISTREAMER_DEBUG + std::cerr << "pqisslpersongrp::locked_createPerson() Is Normal Peer!"; + std::cerr << std::endl; +#endif pqissl *pqis = new pqissl((pqissllistener *) listener, pqip, mLinkMgr); diff --git a/libretroshare/src/pqi/pqithreadstreamer.cc b/libretroshare/src/pqi/pqithreadstreamer.cc index f6b0630f2..40e8f9f5e 100644 --- a/libretroshare/src/pqi/pqithreadstreamer.cc +++ b/libretroshare/src/pqi/pqithreadstreamer.cc @@ -31,6 +31,8 @@ #define DEFAULT_STREAMER_SLEEP 1000 // 1 ms. #define DEFAULT_STREAMER_IDLE_SLEEP 1000000 // 1 sec +//#define PQISTREAMER_DEBUG + pqithreadstreamer::pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& id, BinInterface *bio_in, int bio_flags_in) :pqistreamer(rss, id, bio_in, bio_flags_in), mParent(parent), mThreadMutex("pqithreadstreamer"), mTimeout(0) { @@ -58,9 +60,11 @@ void pqithreadstreamer::start() { // mToRun = true; +#ifdef PQISTREAMER_DEBUG std::cerr << "pqithreadstreamer::run()" << std::endl; std::cerr << " initing should_stop=0" << std::endl; std::cerr << " initing has_stopped=1" << std::endl; +#endif sem_init(&mShouldStopSemaphore,0,0) ; sem_init(&mHasStoppedSemaphore,0,0) ; @@ -70,8 +74,10 @@ void pqithreadstreamer::start() void pqithreadstreamer::run() { +#ifdef PQISTREAMER_DEBUG std::cerr << "pqithreadstream::run()"; std::cerr << std::endl; +#endif // tell the OS to free the thread resources when this function exits // it is a replacement for pthread_join() @@ -84,8 +90,10 @@ void pqithreadstreamer::run() if(sval > 0) { +#ifdef PQISTREAMER_DEBUG std::cerr << "pqithreadstreamer::run(): asked to stop." << std::endl; std::cerr << " setting hasStopped=1" << std::endl; +#endif sem_post(&mHasStoppedSemaphore) ; return ; } @@ -96,18 +104,24 @@ void pqithreadstreamer::run() void pqithreadstreamer::shutdown() { +#ifdef PQISTREAMER_DEBUG std::cerr << "pqithreadstreamer::stop()" << std::endl; +#endif int sval =0; sem_getvalue(&mHasStoppedSemaphore,&sval) ; if(sval > 0) { +#ifdef PQISTREAMER_DEBUG std::cerr << " thread not running. Quit." << std::endl; +#endif return ; } +#ifdef PQISTREAMER_DEBUG std::cerr << " calling stop" << std::endl; +#endif sem_post(&mShouldStopSemaphore) ; } @@ -115,9 +129,13 @@ void pqithreadstreamer::fullstop() { shutdown() ; +#ifdef PQISTREAMER_DEBUG std::cerr << " waiting stop" << std::endl; +#endif sem_wait(&mHasStoppedSemaphore) ; +#ifdef PQISTREAMER_DEBUG std::cerr << " finished!" << std::endl; +#endif } int pqithreadstreamer::data_tick() diff --git a/libretroshare/src/rsserver/p3msgs.cc b/libretroshare/src/rsserver/p3msgs.cc index 43e16a476..ff4c16d3a 100644 --- a/libretroshare/src/rsserver/p3msgs.cc +++ b/libretroshare/src/rsserver/p3msgs.cc @@ -247,7 +247,7 @@ RsPeerId ChatId::toPeerId() const return peer_id; else { - std::cerr << "ChatId Warning: conversation to RsPeerId requested, but type is different." << std::endl; + std::cerr << "ChatId Warning: conversation to RsPeerId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl; return RsPeerId(); } } @@ -257,7 +257,7 @@ RsGxsId ChatId::toGxsId() const return gxs_id; else { - std::cerr << "ChatId Warning: conversation to RsGxsId requested, but type is different." << std::endl; + std::cerr << "ChatId Warning: conversation to RsGxsId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl; return RsGxsId(); } } @@ -267,7 +267,7 @@ ChatLobbyId ChatId::toLobbyId() const return lobby_id; else { - std::cerr << "ChatId Warning: conversation to ChatLobbyId requested, but type is different." << std::endl; + std::cerr << "ChatId Warning: conversation to ChatLobbyId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl; return 0; } } diff --git a/libretroshare/src/serialiser/rstlvgenericmap.inl b/libretroshare/src/serialiser/rstlvgenericmap.inl index 7b852bf0a..87e0d8b04 100644 --- a/libretroshare/src/serialiser/rstlvgenericmap.inl +++ b/libretroshare/src/serialiser/rstlvgenericmap.inl @@ -77,12 +77,14 @@ bool RsTlvGenericPairRef::SetTlv(void *data, uint32_t size, uint32_t *off std::cerr << "RsTlvGenericPairRef<>::SetTlv() Failed"; std::cerr << std::endl; } - else - { - std::cerr << "RsTlvGenericPairRef<>::SetTlv() Ok"; - std::cerr << std::endl; +#ifdef TLV_GENERICMAP_DEBUG + else + { + std::cerr << "RsTlvGenericPairRef<>::SetTlv() Ok"; + std::cerr << std::endl; } - return ok; +#endif + return ok; } template diff --git a/libretroshare/src/services/p3discovery2.cc b/libretroshare/src/services/p3discovery2.cc index f499c37a5..4e9b85b99 100644 --- a/libretroshare/src/services/p3discovery2.cc +++ b/libretroshare/src/services/p3discovery2.cc @@ -1049,18 +1049,18 @@ void p3discovery2::recvPGPCertificate(const SSLID &fromId, RsDiscPgpCertItem *it /************* from pqiServiceMonitor *******************/ void p3discovery2::statusChange(const std::list &plist) { -//#ifdef P3DISC_DEBUG +#ifdef P3DISC_DEBUG std::cerr << "p3discovery2::statusChange()" << std::endl; -//#endif +#endif std::list::const_iterator pit; for(pit = plist.begin(); pit != plist.end(); ++pit) { if (pit->actions & RS_SERVICE_PEER_CONNECTED) { -//#ifdef P3DISC_DEBUG +#ifdef P3DISC_DEBUG std::cerr << "p3discovery2::statusChange() Starting Disc with: " << pit->id << std::endl; -//#endif +#endif sendOwnContactInfo(pit->id); } else if (pit->actions & RS_SERVICE_PEER_DISCONNECTED) @@ -1070,22 +1070,22 @@ void p3discovery2::statusChange(const std::list &plist) if (pit->actions & RS_SERVICE_PEER_NEW) { -//#ifdef P3DISC_DEBUG +#ifdef P3DISC_DEBUG std::cerr << "p3discovery2::statusChange() Adding Friend: " << pit->id << std::endl; -//#endif +#endif addFriend(pit->id); } else if (pit->actions & RS_SERVICE_PEER_REMOVED) { -//#ifdef P3DISC_DEBUG +#ifdef P3DISC_DEBUG std::cerr << "p3discovery2::statusChange() Removing Friend: " << pit->id << std::endl; -//#endif +#endif removeFriend(pit->id); } } -//#ifdef P3DISC_DEBUG +#ifdef P3DISC_DEBUG std::cerr << "p3discovery2::statusChange() finished." << std::endl; -//#endif +#endif return; } diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 15454e9dc..f5a65f743 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -1046,7 +1046,8 @@ bool p3IdService::getGroupData(const uint32_t &token, std::vector group.mPgpKnown = false; group.mPgpId.clear(); - std::cerr << "p3IdService::getGroupData() Failed to decode ServiceString"; + std::cerr << "p3IdService::getGroupData() Failed to decode ServiceString \"" + << group.mMeta.mServiceString << "\"" ; std::cerr << std::endl; } diff --git a/libretroshare/src/services/p3postbase.cc b/libretroshare/src/services/p3postbase.cc index a016d14bc..a4bb48ecb 100644 --- a/libretroshare/src/services/p3postbase.cc +++ b/libretroshare/src/services/p3postbase.cc @@ -325,14 +325,18 @@ void p3PostBase::background_requestUnprocessedGroup() RsStackMutex stack(mPostBaseMtx); /********** STACK LOCKED MTX ******/ if (mBgProcessing) { - std::cerr << "p3PostBase::background_requestUnprocessedGroup() Already Active"; - std::cerr << std::endl; +#ifdef POSTBASE_DEBUG + std::cerr << "p3PostBase::background_requestUnprocessedGroup() Already Active"; + std::cerr << std::endl; +#endif return; } if (mBgGroupList.empty()) { - std::cerr << "p3PostBase::background_requestUnprocessedGroup() No Groups to Process"; - std::cerr << std::endl; +#ifdef POSTBASE_DEBUG + std::cerr << "p3PostBase::background_requestUnprocessedGroup() No Groups to Process"; + std::cerr << std::endl; +#endif return; } diff --git a/libretroshare/src/services/p3serviceinfo.cc b/libretroshare/src/services/p3serviceinfo.cc index 90ccbe49a..0965914e0 100644 --- a/libretroshare/src/services/p3serviceinfo.cc +++ b/libretroshare/src/services/p3serviceinfo.cc @@ -108,7 +108,7 @@ bool p3ServiceInfo::processIncoming() } else { - // error. + // error. std::cerr << "p3ServiceInfo::processingIncoming() Error with Received Item:"; std::cerr << std::endl; item->print(std::cerr); @@ -148,8 +148,10 @@ bool p3ServiceInfo::recvServiceInfoList(RsServiceInfoListItem *item) { RsPeerId peerId = item->PeerId(); - std::cerr << "p3ServiceInfo::recvServiceInfoList() from: " << peerId.toStdString(); - std::cerr << std::endl; +#ifdef DEBUG_INFO + std::cerr << "p3ServiceInfo::recvServiceInfoList() from: " << peerId.toStdString(); + std::cerr << std::endl; +#endif RsPeerServiceInfo info; if (convertServiceItemToInfo(item, info)) @@ -195,8 +197,10 @@ bool p3ServiceInfo::sendPackets() int p3ServiceInfo::sendServiceInfoList(const RsPeerId &peerId) { - std::cerr << "p3ServiceInfo::sendServiceInfoList() to " << peerId.toStdString(); - std::cerr << std::endl; +#ifdef DEBUG_INFO + std::cerr << "p3ServiceInfo::sendServiceInfoList() to " << peerId.toStdString(); + std::cerr << std::endl; +#endif RsServiceInfoListItem *item = new RsServiceInfoListItem(); @@ -204,10 +208,12 @@ int p3ServiceInfo::sendServiceInfoList(const RsPeerId &peerId) bool sent = false; if (mServiceControl->getServicesAllowed(peerId, info)) { - std::cerr << "p3ServiceInfo::sendServiceInfoList() Info: "; +#ifdef DEBUG_INFO + std::cerr << "p3ServiceInfo::sendServiceInfoList() Info: "; std::cerr << std::endl; std::cerr << info; - std::cerr << std::endl; + std::cerr << std::endl; +#endif if (convertServiceInfoToItem(info, item)) { @@ -228,8 +234,10 @@ int p3ServiceInfo::sendServiceInfoList(const RsPeerId &peerId) void p3ServiceInfo::statusChange(const std::list &plist) { - std::cerr << "p3ServiceInfo::statusChange()"; - std::cerr << std::endl; +#ifdef DEBUG_INFO + std::cerr << "p3ServiceInfo::statusChange()"; + std::cerr << std::endl; +#endif std::list::const_iterator it; for (it = plist.begin(); it != plist.end(); ++it) @@ -238,10 +246,12 @@ void p3ServiceInfo::statusChange(const std::list &plist) { if (it->actions & RS_PEER_CONNECTED) { - std::cerr << "p3ServiceInfo::statusChange()"; +#ifdef DEBUG_INFO + std::cerr << "p3ServiceInfo::statusChange()"; std::cerr << "Peer: " << it->id; std::cerr << " Connected"; - std::cerr << std::endl; + std::cerr << std::endl; +#endif RsStackMutex stack(mInfoMtx); /****** LOCKED MUTEX *******/ mPeersToUpdate.insert(it->id); diff --git a/libretroshare/src/util/rsnet_ss.cc b/libretroshare/src/util/rsnet_ss.cc index d07322cac..e89b7dd0b 100644 --- a/libretroshare/src/util/rsnet_ss.cc +++ b/libretroshare/src/util/rsnet_ss.cc @@ -194,9 +194,11 @@ uint16_t sockaddr_storage_port(const struct sockaddr_storage &addr) case AF_INET6: return sockaddr_storage_ipv6_port(addr); break; - default: - std::cerr << "sockaddr_storage_port() invalid addr.ss_family"; - std::cerr << std::endl; + default: +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_port() invalid addr.ss_family: " << addr.ss_family; + std::cerr << std::endl; +#endif break; } return 0; @@ -695,8 +697,10 @@ bool sockaddr_storage_ipv4_setport(struct sockaddr_storage &addr, uint16_t port) bool sockaddr_storage_ipv6_zeroip(struct sockaddr_storage &addr) { - std::cerr << "sockaddr_storage_ipv6_zeroip()"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_zeroip()"; + std::cerr << std::endl; +#endif struct sockaddr_in6 *ipv6_ptr = to_ipv6_ptr(addr); memset(&(ipv6_ptr->sin6_addr), 0, sizeof(ipv6_ptr->sin6_addr)); @@ -705,8 +709,10 @@ bool sockaddr_storage_ipv6_zeroip(struct sockaddr_storage &addr) bool sockaddr_storage_ipv6_copyip(struct sockaddr_storage &dst, const struct sockaddr_storage &src) { - std::cerr << "sockaddr_storage_ipv6_copyip()"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_copyip()"; + std::cerr << std::endl; +#endif struct sockaddr_in6 *dst_ptr = to_ipv6_ptr(dst); const struct sockaddr_in6 *src_ptr = to_const_ipv6_ptr(src); @@ -718,8 +724,10 @@ bool sockaddr_storage_ipv6_copyip(struct sockaddr_storage &dst, const struct soc uint16_t sockaddr_storage_ipv6_port(const struct sockaddr_storage &addr) { +#ifdef SS_DEBUG std::cerr << "sockaddr_storage_ipv6_port()"; - std::cerr << std::endl; + std::cerr << std::endl; +#endif const struct sockaddr_in6 *ipv6_ptr = to_const_ipv6_ptr(addr); uint16_t port = ntohs(ipv6_ptr->sin6_port); @@ -728,8 +736,10 @@ uint16_t sockaddr_storage_ipv6_port(const struct sockaddr_storage &addr) bool sockaddr_storage_ipv6_setport(struct sockaddr_storage &addr, uint16_t port) { - std::cerr << "sockaddr_storage_ipv6_setport()"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_setport()"; + std::cerr << std::endl; +#endif struct sockaddr_in6 *ipv6_ptr = to_ipv6_ptr(addr); ipv6_ptr->sin6_port = htons(port); @@ -818,8 +828,10 @@ bool sockaddr_storage_ipv4_samesubnet(const struct sockaddr_storage &addr, const // IPV6 bool sockaddr_storage_ipv6_lessthan(const struct sockaddr_storage &addr, const struct sockaddr_storage &addr2) { - std::cerr << "sockaddr_storage_ipv6_lessthan()"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_lessthan()"; + std::cerr << std::endl; +#endif const struct sockaddr_in6 *ptr1 = to_const_ipv6_ptr(addr); const struct sockaddr_in6 *ptr2 = to_const_ipv6_ptr(addr2); @@ -841,8 +853,10 @@ bool sockaddr_storage_ipv6_lessthan(const struct sockaddr_storage &addr, const s bool sockaddr_storage_ipv6_same(const struct sockaddr_storage &addr, const struct sockaddr_storage &addr2) { - std::cerr << "sockaddr_storage_ipv6_same()"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_same()"; + std::cerr << std::endl; +#endif const struct sockaddr_in6 *ptr1 = to_const_ipv6_ptr(addr); const struct sockaddr_in6 *ptr2 = to_const_ipv6_ptr(addr2); @@ -851,8 +865,10 @@ bool sockaddr_storage_ipv6_same(const struct sockaddr_storage &addr, const struc bool sockaddr_storage_ipv6_sameip(const struct sockaddr_storage &addr, const struct sockaddr_storage &addr2) { - std::cerr << "sockaddr_storage_ipv6_sameip()"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_sameip()"; + std::cerr << std::endl; +#endif const struct sockaddr_in6 *ptr1 = to_const_ipv6_ptr(addr); const struct sockaddr_in6 *ptr2 = to_const_ipv6_ptr(addr2); @@ -876,8 +892,10 @@ bool sockaddr_storage_ipv6_samenet(const struct sockaddr_storage &addr, const st (void) addr; (void) addr2; - std::cerr << "sockaddr_storage_ipv6_samenet() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_samenet() TODO"; + std::cerr << std::endl; +#endif return false; } @@ -887,8 +905,10 @@ bool sockaddr_storage_ipv6_samesubnet(const struct sockaddr_storage &addr, const (void) addr; (void) addr2; - std::cerr << "sockaddr_storage_ipv6_samesubnet() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_samesubnet() TODO"; + std::cerr << std::endl; +#endif return false; } @@ -1000,40 +1020,50 @@ bool sockaddr_storage_ipv4_isExternalNet(const struct sockaddr_storage &addr) bool sockaddr_storage_ipv6_isnull(const struct sockaddr_storage &addr) { - std::cerr << "sockaddr_storage_ipv6_isnull() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_isnull() TODO"; + std::cerr << std::endl; +#endif return false; } bool sockaddr_storage_ipv6_isValidNet(const struct sockaddr_storage &addr) { - std::cerr << "sockaddr_storage_ipv6_isValidNet() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_isValidNet() TODO"; + std::cerr << std::endl; +#endif return false; } bool sockaddr_storage_ipv6_isLoopbackNet(const struct sockaddr_storage &addr) { - std::cerr << "sockaddr_storage_ipv6_isLoopbackNet() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_isLoopbackNet() TODO"; + std::cerr << std::endl; +#endif return false; } bool sockaddr_storage_ipv6_isPrivateNet(const struct sockaddr_storage &addr) { - std::cerr << "sockaddr_storage_ipv6_isPrivateNet() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_isPrivateNet() TODO"; + std::cerr << std::endl; +#endif return false; } bool sockaddr_storage_ipv6_isExternalNet(const struct sockaddr_storage &addr) { - std::cerr << "sockaddr_storage_ipv6_isExternalNet() TODO"; - std::cerr << std::endl; +#ifdef SS_DEBUG + std::cerr << "sockaddr_storage_ipv6_isExternalNet() TODO"; + std::cerr << std::endl; +#endif return false; } diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 6d2c3e89d..815be38a0 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -843,8 +843,6 @@ void MessagesDialog::insertMessages() return; } - std::cerr <<"MessagesDialog::insertMessages called"; - std::list msgList; std::list::const_iterator it; MessageInfo msgInfo; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index cf3a2922e..f98e2766f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1859,8 +1859,10 @@ void GxsForumThreadWidget::requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair & RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; - std::cerr << std::endl; +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; + std::cerr << std::endl; +#endif GxsMsgReq msgIds; std::vector &vect = msgIds[msgId.first]; @@ -1872,8 +1874,10 @@ void GxsForumThreadWidget::requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair & void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token) { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()"; - std::cerr << std::endl; +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()"; + std::cerr << std::endl; +#endif std::vector msgs; if (rsGxsForums->getMsgData(token, msgs)) @@ -1899,8 +1903,10 @@ void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token) void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenRequest &req) { - std::cerr << "GxsForumThreadWidget::loadRequest() UserType: " << req.mUserType; - std::cerr << std::endl; +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumThreadWidget::loadRequest() UserType: " << req.mUserType; + std::cerr << std::endl; +#endif if (queue == mTokenQueue) { diff --git a/retroshare-gui/src/util/TokenQueue.cpp b/retroshare-gui/src/util/TokenQueue.cpp index d4cd251bf..74f9b35c9 100644 --- a/retroshare-gui/src/util/TokenQueue.cpp +++ b/retroshare-gui/src/util/TokenQueue.cpp @@ -87,9 +87,11 @@ bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokRe void TokenQueue::queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype) { +#ifdef ID_DEBUG std::cerr << "TokenQueue::queueRequest() Token: " << token << " Type: " << basictype; std::cerr << " AnsType: " << anstype << " UserType: " << usertype; - std::cerr << std::endl; + std::cerr << std::endl; +#endif TokenRequest req; req.mToken = token; @@ -210,10 +212,12 @@ void TokenQueue::cancelActiveRequestTokens(const uint32_t& userType) void TokenQueue::loadRequest(const TokenRequest &req) { - std::cerr << "TokenQueue::loadRequest(): "; +#ifdef DEBUG_INFO + std::cerr << "TokenQueue::loadRequest(): "; std::cerr << "Token: " << req.mToken << " Type: " << req.mType; std::cerr << " AnsType: " << req.mAnsType << " UserType: " << req.mUserType; - std::cerr << std::endl; + std::cerr << std::endl; +#endif mResponder->loadRequest(this, req); } @@ -229,10 +233,12 @@ bool TokenQueue::cancelRequest(const uint32_t token) { if (it->mToken == token) { - mRequests.erase(it); + mRequests.erase(it); - std::cerr << "TokenQueue::cancelRequest() Cleared Request: " << token; - std::cerr << std::endl; +#ifdef DEBUG_INFO + std::cerr << "TokenQueue::cancelRequest() Cleared Request: " << token; + std::cerr << std::endl; +#endif return true; }