From 6c7535a3aa07be3babb8bf6f939aaf17f1ca960e Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 28 Jan 2012 13:20:01 +0000 Subject: [PATCH] suppressed debug output git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4860 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/util/pgpkey.cc | 17 ++++++++++++++++- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 4 ++++ retroshare-gui/src/gui/notifyqt.cpp | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/util/pgpkey.cc b/libretroshare/src/util/pgpkey.cc index b815efd21..ea37ec8ec 100644 --- a/libretroshare/src/util/pgpkey.cc +++ b/libretroshare/src/util/pgpkey.cc @@ -5,6 +5,10 @@ #include #include +/****************************/ +/* #define DEBUG_PGPUTIL 1 */ +/****************************/ + #define PGP_PACKET_TAG_PUBLIC_KEY 6 #define PGP_PACKET_TAG_USER_ID 13 #define PGP_PACKET_TAG_SIGNATURE 2 @@ -42,8 +46,10 @@ bool PGPKeyManagement::createMinimalKey(const std::string& pgp_certificate,std:: std::string radix_cert = pgp_certificate.substr(i,j-i) ; +#ifdef DEBUG_PGPUTIL std::cerr << "extracted radix cert: " << std::endl; std::cerr << radix_cert ; +#endif // 1 - Convert armored key into binary key // @@ -55,7 +61,9 @@ bool PGPKeyManagement::createMinimalKey(const std::string& pgp_certificate,std:: unsigned char *data = (unsigned char *)keydata ; +#ifdef DEBUG_PGPUTIL std::cerr << "Total size: " << len << std::endl; +#endif uint8_t packet_tag; uint32_t packet_length ; @@ -69,10 +77,11 @@ bool PGPKeyManagement::createMinimalKey(const std::string& pgp_certificate,std:: while(true) { PGPKeyParser::read_packetHeader(data,packet_tag,packet_length) ; - +#ifdef DEBUG_PGPUTIL std::cerr << "Header:" << std::endl; std::cerr << " Packet tag: " << (int)packet_tag << std::endl; std::cerr << " Packet length: " << packet_length << std::endl; +#endif data += packet_length ; @@ -99,8 +108,10 @@ bool PGPKeyManagement::createMinimalKey(const std::string& pgp_certificate,std:: std::string crc_string ; Radix64::encode((const char *)tmp,3,crc_string) ; +#ifdef DEBUG_PGPUTIL std::cerr << "After signature pruning: " << std::endl; std::cerr << outstring << std::endl; +#endif cleaned_certificate = std::string(PGP_CERTIFICATE_START_STRING) + "\n" + version_string + "\n\n" ; @@ -192,13 +203,17 @@ void PGPKeyParser::read_packetHeader(unsigned char *& data,uint8_t& packet_tag,u if(new_format) { +#ifdef DEBUG_PGPUTIL std::cerr << "Packet is in new format" << std::endl; +#endif packet_tag = b1 & 0x3f ; packet_length = read_125Size(data) ; } else { +#ifdef DEBUG_PGPUTIL std::cerr << "Packet is in old format" << std::endl; +#endif uint8_t length_type = b1 & 0x03 ; packet_tag = (b1 & 0x3c) >> 2 ; diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 9dc0ee260..aff45a225 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -121,14 +121,18 @@ static void updateItem(QTreeWidgetItem *item, ChatLobbyId id, const std::string void ChatLobbyWidget::updateDisplay() { +#ifdef CHAT_LOBBY_GUI_DEBUG std::cerr << "updating chat lobby display!" << std::endl; +#endif std::vector publicLobbies; rsMsgs->getListOfNearbyChatLobbies(publicLobbies); std::list lobbies; rsMsgs->getChatLobbyList(lobbies); +#ifdef CHAT_LOBBY_GUI_DEBUG std::cerr << "got " << publicLobbies.size() << " public lobbies, and " << lobbies.size() << " private lobbies." << std::endl; +#endif // now, do a nice display of lobbies diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index b65495ac2..a69270e3b 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -382,7 +382,9 @@ void NotifyQt::notifyListChange(int list, int type) emit privateChatChanged(list, type); break; case NOTIFY_LIST_CHAT_LOBBY_LIST: +#ifdef NOTIFY_DEBUG std::cerr << "received notify chat lobby list" << std::endl; +#endif emit lobbyListChanged(); case NOTIFY_LIST_GROUPLIST: