diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index c10c9bc47..a18693427 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -1,7 +1,7 @@ TEMPLATE = lib #CONFIG += staticlib release -CONFIG += staticlib testnetwork -#CONFIG += staticlib testnetwork bitdht +#CONFIG += staticlib testnetwork +CONFIG += staticlib testnetwork bitdht CONFIG -= qt TARGET = retroshare @@ -36,7 +36,6 @@ testnetwork { } - #CONFIG += debug debug { # DEFINES *= DEBUG diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc index 94c110d34..1d7b3a3ba 100644 --- a/libretroshare/src/pqi/pqissl.cc +++ b/libretroshare/src/pqi/pqissl.cc @@ -1364,6 +1364,26 @@ int pqissl::senddata(void *data, int len) out << std::endl; std::cerr << 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(); return -1; } @@ -1488,6 +1508,26 @@ int pqissl::readdata(void *data, int len) out << "Socket Closed Abruptly.... Resetting PQIssl"; out << std::endl; 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(); std::cerr << out.str() << std::endl ; return -1; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 1a7916af9..d3606b17c 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -2264,6 +2264,7 @@ int RsServer::StartupRetroShare() #ifdef RS_USE_BITDHT mConnMgr->addNetAssistConnect(1, mBitDht); + mConnMgr->addNetListener(mUdpStack); #endif mConnMgr->addNetAssistFirewall(1, mUpnpMgr); @@ -2372,7 +2373,6 @@ int RsServer::StartupRetroShare() pqih->init_listener(); mConnMgr->addNetListener(pqih); /* add listener so we can reset all sockets later */ - mConnMgr->addNetListener(mUdpStack); diff --git a/libretroshare/src/tcponudp/tou.cc b/libretroshare/src/tcponudp/tou.cc index 70e1637a3..f93a2b1fc 100644 --- a/libretroshare/src/tcponudp/tou.cc +++ b/libretroshare/src/tcponudp/tou.cc @@ -66,8 +66,9 @@ static UdpPeerReceiver *udps = NULL; static int tou_tick_all(); /* 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) { return 1; diff --git a/libretroshare/src/tcponudp/tou.h b/libretroshare/src/tcponudp/tou.h index 8fb31fec9..2129e7312 100644 --- a/libretroshare/src/tcponudp/tou.h +++ b/libretroshare/src/tcponudp/tou.h @@ -58,8 +58,9 @@ * (1) need UdpStack item, which has our address already. */ -class UdpStack; -int tou_init(UdpStack *stack); +// hack to avoid classes in C code. (MacOSX complaining) +// will pass as UdpStack * as void * +int tou_init(void *udpStack); #ifdef __cplusplus