* Fixed up UDP Port "netReset()" (was stuck on 7812, now follows your tcp port).

* OSX Bug: doesn't like classes in C files. switched to void * pointer.
 * A little extra debugging in pqissl on disconnects.
 * switched on bitdht by default in libretroshare.pro



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3334 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2010-08-02 23:21:59 +00:00
parent 7318fdf9c8
commit 627b0f88a2
5 changed files with 48 additions and 7 deletions

View File

@ -1,7 +1,7 @@
TEMPLATE = lib TEMPLATE = lib
#CONFIG += staticlib release #CONFIG += staticlib release
CONFIG += staticlib testnetwork #CONFIG += staticlib testnetwork
#CONFIG += staticlib testnetwork bitdht CONFIG += staticlib testnetwork bitdht
CONFIG -= qt CONFIG -= qt
TARGET = retroshare TARGET = retroshare
@ -36,7 +36,6 @@ testnetwork {
} }
#CONFIG += debug #CONFIG += debug
debug { debug {
# DEFINES *= DEBUG # DEFINES *= DEBUG

View File

@ -1364,6 +1364,26 @@ int pqissl::senddata(void *data, int len)
out << std::endl; out << std::endl;
std::cerr << out.str() ; std::cerr << out.str() ;
rslog(RSL_ALERT, pqisslzone, out.str()); rslog(RSL_ALERT, pqisslzone, out.str());
/* extra debugging - based on SSL_get_error() man page */
{
int errsys = errno;
int sslerr = 0;
std::ostringstream out2;
out2 << "SSL_ERROR_SYSCALL, ret == " << tmppktlen;
out2 << " errno: " << errsys << std::endl;
while(0 != (sslerr = ERR_get_error()))
{
out2 << "SSLERR:" << sslerr << " : ";
char sslbuf[256] = {0};
out2 << ERR_error_string(sslerr, sslbuf);
out2 << std::endl;
}
rslog(RSL_ALERT, pqisslzone, out2.str());
}
reset(); reset();
return -1; return -1;
} }
@ -1488,6 +1508,26 @@ int pqissl::readdata(void *data, int len)
out << "Socket Closed Abruptly.... Resetting PQIssl"; out << "Socket Closed Abruptly.... Resetting PQIssl";
out << std::endl; out << std::endl;
rslog(RSL_ALERT, pqisslzone, out.str()); rslog(RSL_ALERT, pqisslzone, out.str());
/* extra debugging - based on SSL_get_error() man page */
{
int syserr = errno;
int sslerr = 0;
std::ostringstream out2;
out2 << "SSL_ERROR_SYSCALL, ret == " << tmppktlen;
out2 << " errno: " << syserr << std::endl;
while(0 != (sslerr = ERR_get_error()))
{
out2 << "SSLERR:" << sslerr << " : ";
char sslbuf[256] = {0};
out2 << ERR_error_string(sslerr, sslbuf);
out2 << std::endl;
}
rslog(RSL_ALERT, pqisslzone, out2.str());
}
reset(); reset();
std::cerr << out.str() << std::endl ; std::cerr << out.str() << std::endl ;
return -1; return -1;

View File

@ -2264,6 +2264,7 @@ int RsServer::StartupRetroShare()
#ifdef RS_USE_BITDHT #ifdef RS_USE_BITDHT
mConnMgr->addNetAssistConnect(1, mBitDht); mConnMgr->addNetAssistConnect(1, mBitDht);
mConnMgr->addNetListener(mUdpStack);
#endif #endif
mConnMgr->addNetAssistFirewall(1, mUpnpMgr); mConnMgr->addNetAssistFirewall(1, mUpnpMgr);
@ -2372,7 +2373,6 @@ int RsServer::StartupRetroShare()
pqih->init_listener(); pqih->init_listener();
mConnMgr->addNetListener(pqih); /* add listener so we can reset all sockets later */ mConnMgr->addNetListener(pqih); /* add listener so we can reset all sockets later */
mConnMgr->addNetListener(mUdpStack);

View File

@ -66,8 +66,9 @@ static UdpPeerReceiver *udps = NULL;
static int tou_tick_all(); static int tou_tick_all();
/* tou_init - opens the udp port (universal bind) */ /* tou_init - opens the udp port (universal bind) */
int tou_init(UdpStack *stack) int tou_init(void *in_udpstack)
{ {
UdpStack *stack = (UdpStack *) in_udpstack;
if (tou_inited) if (tou_inited)
{ {
return 1; return 1;

View File

@ -58,8 +58,9 @@
* (1) need UdpStack item, which has our address already. * (1) need UdpStack item, which has our address already.
*/ */
class UdpStack; // hack to avoid classes in C code. (MacOSX complaining)
int tou_init(UdpStack *stack); // will pass as UdpStack * as void *
int tou_init(void *udpStack);
#ifdef __cplusplus #ifdef __cplusplus