From 6fe16d55e18299744862e40f7c3ec27f351d38d4 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 29 Nov 2013 22:09:13 +0000 Subject: [PATCH] fixed up some debug text (patch from H.Morgan) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6917 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pgp/pgphandler.cc | 2 +- libretroshare/src/rsserver/rsinit.cc | 6 ++---- libretroshare/src/services/p3chatservice.cc | 6 +++--- libretroshare/src/services/p3msgservice.cc | 21 +++++++++++---------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index bc8bb3e9b..470e967a3 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -1616,7 +1616,7 @@ void PGPHandler::locked_readPrivateTrustDatabase() fclose(fdb) ; - std::cerr << "PGPHandler: Successfully read " << n_packets << " trust packets." << std::endl; + std::cerr << "PGPHandler: Successfully read " << std::hex << n_packets << std::dec << " trust packets." << std::endl; } bool PGPHandler::locked_writePrivateTrustDatabase() diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index f8f982ff3..7cb83d6c0 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -530,13 +530,11 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck if (0 == sigaction(SIGPIPE, &sigact, NULL)) { - std::cerr << "RetroShare:: Successfully Installed"; - std::cerr << "the SIGPIPE Block" << std::endl; + std::cerr << "RetroShare:: Successfully installed the SIGPIPE Block" << std::endl; } else { - std::cerr << "RetroShare:: Failed to Install"; - std::cerr << "the SIGPIPE Block" << std::endl; + std::cerr << "RetroShare:: Failed to install the SIGPIPE Block" << std::endl; } #endif /******************************** WINDOWS/UNIX SPECIFIC PART ******************/ diff --git a/libretroshare/src/services/p3chatservice.cc b/libretroshare/src/services/p3chatservice.cc index 3cf5453d8..49a823501 100644 --- a/libretroshare/src/services/p3chatservice.cc +++ b/libretroshare/src/services/p3chatservice.cc @@ -578,7 +578,7 @@ bool p3ChatService::locked_checkAndRebuildPartialMessage_deprecated(RsChatMsgIte if(it != _pendingPartialMessages.end()) { #ifdef CHAT_DEBUG - std::cerr << "Pending message found. Happending it." << std::endl; + std::cerr << "Pending message found. Appending it." << std::endl; #endif // Yes, there is. Append the item to ci. @@ -623,7 +623,7 @@ bool p3ChatService::locked_checkAndRebuildPartialMessage(RsChatLobbyMsgItem *ci) if(it != _pendingPartialLobbyMessages.end()) { #ifdef CHAT_DEBUG - std::cerr << " Pending message found. Happending it." << std::endl; + std::cerr << " Pending message found. Aappending it." << std::endl; #endif // Yes, there is. Add the item to the list of stored sub-items @@ -659,7 +659,7 @@ bool p3ChatService::locked_checkAndRebuildPartialMessage(RsChatLobbyMsgItem *ci) delete it->second[i] ; } _pendingPartialLobbyMessages.erase(it) ; - + ci->chatFlags = flags ; ci->message = msg ; ci->chatFlags &= ~RS_CHAT_FLAG_PARTIAL_MESSAGE ; // remove partial flag form message. diff --git a/libretroshare/src/services/p3msgservice.cc b/libretroshare/src/services/p3msgservice.cc index 7377c9dbf..b4b8d297e 100644 --- a/libretroshare/src/services/p3msgservice.cc +++ b/libretroshare/src/services/p3msgservice.cc @@ -45,6 +45,7 @@ #include #include +//#define MSG_DEBUG 1 //#define DEBUG_DISTANT_MSG //#define DISABLE_DISTANT_MESSAGES @@ -181,9 +182,9 @@ bool p3MsgService::checkAndRebuildPartialMessage(RsMsgItem *ci) if(it != _pendingPartialMessages.end()) { -//#ifdef CHAT_DEBUG - std::cerr << "Pending message found. Happending it." << std::endl; -//#endif +#ifdef MSG_DEBUG + std::cerr << "Pending message found. Appending it." << std::endl; +#endif // Yes, there is. Append the item to ci. ci->message = it->second->message + ci->message ; @@ -197,9 +198,9 @@ bool p3MsgService::checkAndRebuildPartialMessage(RsMsgItem *ci) if(ci_is_partial) { -//#ifdef CHAT_DEBUG +#ifdef MSG_DEBUG std::cerr << "Message is partial, storing for later." << std::endl; -//#endif +#endif // The item is a partial message. Push it, and wait for the rest. // _pendingPartialMessages[ci->PeerId()] = ci ; @@ -207,9 +208,9 @@ bool p3MsgService::checkAndRebuildPartialMessage(RsMsgItem *ci) } else { -//#ifdef CHAT_DEBUG +#ifdef MSG_DEBUG std::cerr << "Message is complete, using it now." << std::endl; -//#endif +#endif return true ; } } @@ -585,7 +586,7 @@ bool p3MsgService::loadList(std::list& load) for(std::list::const_iterator kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) if(kit->key == "DISTANT_MESSAGES_ENABLED") { -#ifdef CHAT_DEBUG +#ifdef MSG_DEBUG std::cerr << "Loaded config default nick name for distant chat: " << kit->value << std::endl ; #endif enableDistantMessaging(kit->value == "YES") ; @@ -1762,7 +1763,7 @@ bool p3MsgService::encryptMessage(const std::string& pgp_id,RsMsgItem *item) std::cerr << "Encrypting message with public key " << pgp_id << " in place." << std::endl; #endif - // 0 - happend own id to the data. + // 0 - append own id to the data. // uint32_t rssize = _serialiser->size(item) ; unsigned char *data = (unsigned char *)malloc(1+rssize+KEY_ID_SIZE) ; @@ -1818,7 +1819,7 @@ bool p3MsgService::encryptMessage(const std::string& pgp_id,RsMsgItem *item) #ifdef DEBUG_DISTANT_MSG std::cerr << " total decrypted size = " << KEY_ID_SIZE + 1 + rssize + signature_length << std::endl; #endif - // 3 - happend the signature to the serialized data. + // 3 - append the signature to the serialized data. if(signature_length > 0) {