Major cleanup of Retroshare Logging - aimed at enabling proper UDP testing.

* Switched off most of std::cerr output. (expect UPnP)
 * moved pqi/pqidebug to util/rsdebug to allow greater usage.
 * added Mutexes to logging.
 * Downgraded many log messages to DEBUG.
 * New Log messages for connections, dht and udp code.
 * Added check for bad UDP socket.
 * Added check for non-firewalled scenario.
 * Increased Storage period from 1 Month to 6 Months for Links & Blog.




git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@644 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-07-10 16:29:18 +00:00
parent afeb93d0f3
commit d36b15d526
33 changed files with 867 additions and 346 deletions

View file

@ -32,6 +32,9 @@
#include <sstream>
#include <iomanip>
#include "util/rsdebug.h"
const int rsudpsorterzone = 28477;
static const int STUN_TTL = 64;
/*
@ -86,6 +89,10 @@ void UdpSorter::recvPkt(void *data, int size, struct sockaddr_in &from)
std::cerr << "UdpSorter::recvPkt() Peer Unknown!";
std::cerr << std::endl;
#endif
std::ostringstream out;
out << "UdpSorter::recvPkt() ";
out << "from unknown: " << from;
rslog(RSL_WARNING,rsudpsorterzone,out.str());
}
else
{
@ -233,6 +240,11 @@ bool UdpSorter::locked_handleStunPkt(void *data, int size, struct sockaddr_in &f
std::cerr << inet_ntoa(from.sin_addr) << ":" << ntohs(from.sin_port);
std::cerr << std::endl;
#endif
{
std::ostringstream out;
out << "UdpSorter::handleStunPkt() got Request from: " << from;
rslog(RSL_WARNING,rsudpsorterzone,out.str());
}
/* generate a response */
int len;
@ -266,6 +278,13 @@ bool UdpSorter::locked_handleStunPkt(void *data, int size, struct sockaddr_in &f
std::cerr << inet_ntoa(eAddr.sin_addr) << ":" << ntohs(eAddr.sin_port);
std::cerr << std::endl;
#endif
{
std::ostringstream out;
out << "UdpSorter::handleStunPkt() got Response from: " << from;
out << " Ext Addr: " << eAddr;
rslog(RSL_WARNING,rsudpsorterzone,out.str());
}
locked_recvdStun(from, eAddr);
return true;