further log cleanings

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2239 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-02-08 14:06:43 +00:00
parent f14f4f58d7
commit 6f1e4623ab
11 changed files with 38 additions and 15 deletions

View File

@ -135,7 +135,9 @@ bool ftFileProvider::getFileData(uint64_t offset, uint32_t &chunk_size, void *da
if (1 != fread(data, data_size, 1, fd))
{
std::cerr << "ftFileProvider::getFileData() Failed to get data. Data_size=" << data_size << ", base_loc=" << base_loc << " !";
#ifdef DEBUG_FT_FILE_PROVIDER
std::cerr << "ftFileProvider::getFileData() Failed to get data. Data_size=" << data_size << ", base_loc=" << base_loc << " !" << std::endl;
#endif
//free(data); No!! It's already freed upwards in ftDataMultiplex::locked_handleServerRequest()
return 0;
}

View File

@ -731,7 +731,7 @@ bool AuthGPG::VerifySignature_locked(const void *data, int datalen, const void *
if(siglen==73)
{
std::cerr << "Reducing to 72 to overcome an old bug." << std::endl ;
//std::cerr << "Reducing to 72 to overcome an old bug." << std::endl ;
siglen=72 ;
}
@ -1114,7 +1114,7 @@ std::string AuthGPG::SaveCertificateToString(std::string id)
gpgme_data_write (gpgmeData, "", 1); // to be able to convert it into a string
fflush (NULL);
showData (gpgmeData);
//showData (gpgmeData);
size_t len = 0;
char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len);

View File

@ -2167,7 +2167,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
{
X509_NAME_oneline(X509_get_issuer_name(X509_STORE_CTX_get_current_cert(ctx)), buf, 256);
#ifdef AUTHSSL_DEBUG
printf("issuer= %s\n", buf);
#endif
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "Doing REAL PGP Certificates\n");
@ -2175,24 +2177,30 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
/* do the REAL Authentication */
if (!AuthX509(X509_STORE_CTX_get_current_cert(ctx)))
{
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "AuthSSL::VerifyX509Callback() X509 not authenticated.\n");
#endif
return false;
}
std::string pgpid = getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer);
if (!AuthGPG::getAuthGPG()->isGPGAccepted(pgpid) && pgpid != AuthGPG::getAuthGPG()->getGPGOwnId())
{
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "AuthSSL::VerifyX509Callback() pgp key not signed by ourself : \n");
fprintf(stderr, "issuer pgpid : ");
fprintf(stderr, "%s\n",pgpid.c_str());
fprintf(stderr, "\n AuthGPG::getAuthGPG()->getGPGOwnId() : ");
fprintf(stderr, "%s\n",AuthGPG::getAuthGPG()->getGPGOwnId().c_str());
fprintf(stderr, "\n");
#endif
return false;
}
preverify_ok = true;
} else {
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "Failing Normal Certificate!!!\n");
#endif
preverify_ok = false;
}
@ -2214,7 +2222,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
char *peer_id_in_context = (char*) SSL_get_ex_data(ssl, AuthSSL::ex_data_ctx_index);
if (std::string(certId.c_str()) != std::string(peer_id_in_context)) {
//the connection was asked for a given peer and get connected top another peer
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context not the same as cert, aborting connection.");
#endif
preverify_ok = false;
//tranfer the ip address to the new peer
@ -2224,7 +2234,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
mConnMgr->setAddressList(certId, detail.getIpAddressList());
}
} else {
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context is the same as cert, continung connection.");
#endif
}
}
@ -2238,7 +2250,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
peerConnectState detail;
if (mConnMgr->getFriendNetStatus(certId, detail)) {
if (detail.state & RS_PEER_CONNECTED && !(detail.connecttype & RS_NET_CONN_TUNNEL)) {
#ifdef AUTHSSL_DEBUG
fprintf(stderr, "AuthSSL::VerifyX509Callback this peer is already connected, refuse a new connection.");
#endif
preverify_ok = false;
}
}
@ -2246,11 +2260,14 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
}
#ifdef AUTHSSL_DEBUG
if (preverify_ok) {
fprintf(stderr, "AuthSSL::VerifyX509Callback returned true.\n");
} else {
fprintf(stderr, "AuthSSL::VerifyX509Callback returned false.\n");
}
#endif
return preverify_ok;
}

View File

@ -249,7 +249,7 @@ int pqiperson::notifyEvent(NetInterface *ni, int newState)
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, out.str());
it->second->reset();
} else {
std::cerr << "Active pqi : not resetting." << std::endl;
//std::cerr << "Active pqi : not resetting." << std::endl;
}
}
return 1;

View File

@ -349,8 +349,8 @@ int pqistore::readPkt(RsItem **item_out)
}
// create packet, based on header.
std::cerr << "Read Data Block -> Incoming Pkt(";
std::cerr << blen + extralen << ")" << std::endl;
//std::cerr << "Read Data Block -> Incoming Pkt(";
//std::cerr << blen + extralen << ")" << std::endl;
uint32_t readbytes = extralen + blen;
RsItem *item = rsSerialiser->deserialise(block, &readbytes);

View File

@ -488,10 +488,8 @@ bool p3Peers::getGPGSignedList(std::list<std::string> &ids)
bool p3Peers::getGPGAcceptedList(std::list<std::string> &ids)
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::getPGPOthersList()" << std::endl;
std::cerr << "p3Peers::getGPGAcceptedList()" << std::endl;
#endif
//TODO implement an additional list of GPG keys that are accepted even if not signed
AuthGPG::getAuthGPG()->getGPGAcceptedList(ids);
return true;
}
@ -511,7 +509,7 @@ bool p3Peers::getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string>
peerConnectState pcs;
for (std::list<std::string>::iterator it = friendsIds.begin(); it != friendsIds.end(); it++) {
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::getSSLChildListOfGPGId() iterating over friends id : " << gpg_id << std::endl;
std::cerr << "p3Peers::getSSLChildListOfGPGId() iterating over friends id : " << *it << std::endl;
#endif
if (mConnMgr->getFriendNetStatus(*it, pcs) && pcs.gpg_id == gpg_id) {
#ifdef P3PEERS_DEBUG
@ -896,7 +894,9 @@ bool p3Peers::loadDetailsFromStringCert(std::string certstr, RsPeerDetails &pd)
}
}
#ifdef P3PEERS_DEBUG
std::cerr << "Parsing cert for sslid, location, ext and local address details. : " << certstr << std::endl;
#endif
//let's parse the ssl id
parsePosition = certstr.find(CERT_SSL_ID);

View File

@ -29,7 +29,7 @@
#include "serialiser/rsbaseserial.h"
#include "serialiser/rstlvbase.h"
#define RSSERIAL_DEBUG 1
//#define RSSERIAL_DEBUG 1
#include <iostream>
/*************************************************************************/

View File

@ -632,8 +632,10 @@ bool CUPnPService::Execute(
#endif
return false;
}
std::cerr << ActionName << "(";
bool firstTime = true;
#ifdef UPNP_DEBUG
std::cerr << ActionName << "(";
#endif
bool firstTime = true;
// Check for correct Argument/Value pairs
const CUPnPAction &action = *(itAction->second);
for (unsigned int i = 0; i < ArgValue.size(); ++i) {

View File

@ -300,7 +300,6 @@ void MessengerWindow::insertPeers()
//add the gpg friends
for(it = gpgFriends.begin(); it != gpgFriends.end(); it++) {
std::cerr << "" << *it << std::endl;
// if (*it == rsPeers->getGPGOwnId()) {
// continue;
// }

View File

@ -326,6 +326,9 @@ void PeersDialog::updateDisplay()
/* get the list of peers from the RsIface. */
void PeersDialog::insertPeers()
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::insertPeers() called." << std::endl;
#endif
std::list<std::string> gpgFriends;
std::list<std::string>::iterator it;

View File

@ -233,7 +233,7 @@ void NotifyQt::UpdateGUI()
/* id the name */
std::string name = rsPeers->getPeerName(id);
std::cerr << "NotifyQT got message for peer id : " << id << "; name : " << name << std::endl;
//std::cerr << "NotifyQT got message for peer id : " << id << "; name : " << name << std::endl;
std::string realmsg = "<strong>" + name + "</strong>";
switch(type)
{