diff --git a/libretroshare/src/pqi/authxpgp.cc b/libretroshare/src/pqi/authxpgp.cc index fddfb52e0..5b7847d09 100644 --- a/libretroshare/src/pqi/authxpgp.cc +++ b/libretroshare/src/pqi/authxpgp.cc @@ -633,16 +633,34 @@ bool AuthXPGP::SignCertificate(std::string id) if (locked_FindCert(id, &cert)) { - XPGP_sign_certificate(pgp_keyring, cert->certificate, own->certificate); + if (0 < validateCertificateIsSignedByKey( + cert->certificate, own->certificate)) + { +#ifdef AUTHXPGP_DEBUG + std::cerr << "AuthXPGP::SignCertificate() Signed Already: " << id; + std::cerr << std::endl; +#endif + cert->ownsign=true; + } + else + { +#ifdef AUTHXPGP_DEBUG + std::cerr << "AuthXPGP::SignCertificate() Signing Cert: " << id; + std::cerr << std::endl; +#endif + /* sign certificate */ + XPGP_sign_certificate(pgp_keyring, cert->certificate, own->certificate); - /* reevaluate the auth of the xpgp */ - cert->trustLvl = XPGP_auth_certificate(pgp_keyring, cert->certificate); - cert->ownsign = true; + /* reevaluate the auth of the xpgp */ + cert->trustLvl = XPGP_auth_certificate(pgp_keyring, cert->certificate); + cert->ownsign = true; + + mToSaveCerts = true; + } valid = true; - - mToSaveCerts = true; } + xpgpMtx.unlock(); /**** UNLOCK ****/ return valid; } @@ -751,6 +769,8 @@ bool AuthXPGP::AuthCertificate(std::string id) /* reevaluate the auth of the xpgp */ cert->trustLvl = XPGP_auth_certificate(pgp_keyring, cert->certificate); cert->ownsign = true; + + mToSaveCerts = true; } valid = true; } @@ -2083,13 +2103,15 @@ bool AuthXPGP::loadCertificates(bool &oldFormat, std::map first] = mit -> second; } + + mToSaveCerts = false; + if (keyValueMap.size() > 0) { oldFormat = true; mToSaveCerts = true; } - mToSaveCerts = false; return true; } diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index e450515da..cdd049942 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -811,7 +811,7 @@ bool p3ConnectMgr::stunCheck() bool stunOk = false; #ifdef CONN_DEBUG - std::cerr << "p3ConnectMgr::stunCheck()" << std::endl; + //std::cerr << "p3ConnectMgr::stunCheck()" << std::endl; #endif { diff --git a/libretroshare/src/pqi/pqiloopback.cc b/libretroshare/src/pqi/pqiloopback.cc index c9be77373..457548d33 100644 --- a/libretroshare/src/pqi/pqiloopback.cc +++ b/libretroshare/src/pqi/pqiloopback.cc @@ -26,6 +26,10 @@ #include "pqi/pqi.h" #include "pqi/pqiloopback.h" +/*** +#define LOOPBACK_DEBUG 1 +***/ + pqiloopback::pqiloopback(std::string id) :PQInterface(id) { @@ -44,6 +48,13 @@ pqiloopback::~pqiloopback() int pqiloopback::SendItem(RsItem *i) { + +#ifdef LOOPBACK_DEBUG + std::cerr << "pqiloopback::SendItem()"; + std::cerr << std::endl; + i->print(std::cerr); + std::cerr << std::endl; +#endif objs.push_back(i); return 1; } @@ -54,6 +65,12 @@ RsItem * pqiloopback::GetItem() { RsItem *pqi = objs.front(); objs.pop_front(); +#ifdef LOOPBACK_DEBUG + std::cerr << "pqiloopback::GetItem()"; + std::cerr << std::endl; + pqi->print(std::cerr); + std::cerr << std::endl; +#endif return pqi; } return NULL; diff --git a/libretroshare/src/rsiface/rsmsgs.h b/libretroshare/src/rsiface/rsmsgs.h index 79af976fd..a3c73bac9 100644 --- a/libretroshare/src/rsiface/rsmsgs.h +++ b/libretroshare/src/rsiface/rsmsgs.h @@ -127,6 +127,7 @@ virtual bool MessageRead(std::string mid) = 0; /****************************************/ /* Chat */ +virtual bool chatAvailable() = 0; virtual bool ChatSend(ChatInfo &ci) = 0; virtual bool getNewChat(std::list &chats) = 0; diff --git a/libretroshare/src/rsserver/p3face-config.cc b/libretroshare/src/rsserver/p3face-config.cc index c18298bb8..370a80bae 100644 --- a/libretroshare/src/rsserver/p3face-config.cc +++ b/libretroshare/src/rsserver/p3face-config.cc @@ -254,6 +254,8 @@ int RsServer::ConfigSetDataRates( int total, int indiv ) /* in kbrates */ pqih -> setMaxIndivRate(true, indiv); pqih -> setMaxIndivRate(false, indiv); + pqih -> save_config(); + /* unlock Mutexes */ iface.unlockData(); /* UNLOCK */ unlockRsCore(); /* UNLOCK */ diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index dd865625a..39cc4b58b 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -78,8 +78,8 @@ void RsServer::run() double timeDelta = 0.25; double minTimeDelta = 0.1; // 25; - double maxTimeDelta = 1.0; - double kickLimit = 0.5; + double maxTimeDelta = 0.5; + double kickLimit = 0.15; double avgTickRate = timeDelta; diff --git a/libretroshare/src/rsserver/p3msgs.cc b/libretroshare/src/rsserver/p3msgs.cc index 0ad751def..862c02487 100644 --- a/libretroshare/src/rsserver/p3msgs.cc +++ b/libretroshare/src/rsserver/p3msgs.cc @@ -106,6 +106,11 @@ bool p3Msgs::ChatSend(ChatInfo &ci) return true; } +bool p3Msgs::chatAvailable() +{ + return mChatSrv->receivedItems(); +} + bool p3Msgs::getNewChat(std::list &chats) { /* get any messages and push them to iface */ diff --git a/libretroshare/src/rsserver/p3msgs.h b/libretroshare/src/rsserver/p3msgs.h index a4c833890..36b741e4d 100644 --- a/libretroshare/src/rsserver/p3msgs.h +++ b/libretroshare/src/rsserver/p3msgs.h @@ -52,6 +52,7 @@ virtual bool MessageRead(std::string mid); /****************************************/ /* Chat */ +virtual bool chatAvailable(); virtual bool ChatSend(ChatInfo &ci); virtual bool getNewChat(std::list &chats); diff --git a/libretroshare/src/services/p3chatservice.cc b/libretroshare/src/services/p3chatservice.cc index 288f277d1..a72325198 100644 --- a/libretroshare/src/services/p3chatservice.cc +++ b/libretroshare/src/services/p3chatservice.cc @@ -140,6 +140,12 @@ std::list p3ChatService::getChatQueue() while(NULL != (ci = (RsChatItem *) recvItem())) { +#ifdef CHAT_DEBUG + std::cerr << "p3ChatService::getChatQueue() Item:"; + std::cerr << std::endl; + ci->print(std::cerr); + std::cerr << std::endl; +#endif ci->recvTime = now; ilist.push_back(ci); }