Removed some cruft like mymethod(){return;} from pqi

This commit is contained in:
Gio 2015-10-30 09:23:59 +01:00
parent 12acf6de35
commit 30e40470e2
7 changed files with 120 additions and 142 deletions

View File

@ -267,8 +267,8 @@ const uint32_t PQI_CONNECT_HIDDEN_I2P_TCP = 0x0008;
class BinInterface
{
public:
BinInterface() { return; }
virtual ~BinInterface() { return; }
BinInterface() {}
virtual ~BinInterface() {}
/**
* To be called loop, for updating state
@ -360,13 +360,17 @@ public:
/**
* @param p_in used to notify system of connect/disconnect events
*/
NetInterface(PQInterface *p_in, const RsPeerId& id)
:p(p_in), peerId(id) { return; }
NetInterface(PQInterface *p_in, const RsPeerId& id) : p(p_in), peerId(id) {}
virtual ~NetInterface()
{ return; }
virtual ~NetInterface() {}
/* TODO
* The data entrypoint is connect(const struct sockaddr_storage &raddr)
* To generalize NetInterface we should have a more general type for raddr
* As an example a string containing an url or encoded like a domain name
*/
virtual int connect(const struct sockaddr_storage &raddr) = 0;
virtual int listen() = 0;
virtual int stoplistening() = 0;
virtual int disconnect() = 0;
@ -397,10 +401,9 @@ private:
class NetBinInterface: public NetInterface, public BinInterface
{
public:
NetBinInterface(PQInterface *parent, const RsPeerId& id)
:NetInterface(parent, id)
{ return; }
virtual ~NetBinInterface() { return; }
NetBinInterface(PQInterface *parent, const RsPeerId& id) :
NetInterface(parent, id) {}
virtual ~NetBinInterface() {}
};
#define CHAN_SIGN_SIZE 16

View File

@ -32,20 +32,13 @@
class pqilistener
{
public:
pqilistener() { return; }
virtual ~pqilistener() { return; }
pqilistener() {}
virtual ~pqilistener() {}
virtual int tick() { return 1; }
virtual int status() { return 1; }
virtual int setListenAddr(const struct sockaddr_storage &addr)
{
(void) addr; /* suppress unused parameter warning */
return 1;
}
virtual int setListenAddr(const sockaddr_storage & /*addr*/) { return 1; }
virtual int setuplisten() { return 1; }
virtual int resetlisten() { return 1; }
};

View File

@ -1936,10 +1936,7 @@ bool pqissl::cansend(uint32_t usec)
}
RsFileHash pqissl::gethash()
{
return RsFileHash() ;
}
RsFileHash pqissl::gethash() { return RsFileHash(); }
/********** End of Implementation of BinInterface ******************/

View File

@ -170,7 +170,10 @@ int Extract_Failed_SSL_Certificate(); // try to get cert anyway.
bool CheckConnectionTimeout();
//protected internal fns that are overloaded for udp case.
/* Do we really need this ?
* It is very specific TCP+SSL stuff and unlikely to be reused.
* In fact we are overloading them in pqissludp case where they do different things or nothing.
*/
virtual int net_internal_close(int fd);
virtual int net_internal_SSL_set_fd(SSL *ssl, int fd);
virtual int net_internal_fcntl_nonblock(int fd);
@ -206,11 +209,9 @@ virtual int net_internal_fcntl_nonblock(int fd);
uint32_t mConnectTimeout;
time_t mTimeoutTS;
private:
// ssl only fns.
int connectInterface(const struct sockaddr_storage &addr);
};

View File

@ -50,12 +50,11 @@ class p3PeerMgr;
class AcceptedSSL
{
public:
int mFd;
SSL *mSSL;
RsPeerId mPeerId;
struct sockaddr_storage mAddr;
sockaddr_storage mAddr;
time_t mAcceptTS;
};
@ -65,8 +64,6 @@ class AcceptedSSL
class pqissllistenbase: public pqilistener
{
public:
pqissllistenbase(const struct sockaddr_storage &addr, p3PeerMgr *pm);
virtual ~pqissllistenbase();

View File

@ -51,16 +51,16 @@ static const uint32_t PQI_SSLUDP_DEF_CONN_PERIOD = 300; /* 5 minutes? */
/********** PQI SSL UDP STUFF **************************************/
pqissludp::pqissludp(PQInterface *parent, p3LinkMgr *lm)
:pqissl(NULL, parent, lm), tou_bio(NULL),
listen_checktime(0), mConnectPeriod(PQI_SSLUDP_DEF_CONN_PERIOD), mConnectFlags(0), mConnectBandwidth(0)
pqissludp::pqissludp(PQInterface *parent, p3LinkMgr *lm) :
pqissl(NULL, parent, lm), tou_bio(NULL), listen_checktime(0),
mConnectPeriod(PQI_SSLUDP_DEF_CONN_PERIOD), mConnectFlags(0),
mConnectBandwidth(0)
{
RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
RS_STACK_MUTEX(mSslMtx);
sockaddr_storage_clear(remote_addr);
sockaddr_storage_clear(mConnectProxyAddr);
sockaddr_storage_clear(mConnectSrcAddr);
return;
}
@ -79,14 +79,11 @@ pqissludp::~pqissludp()
stoplistening(); /* remove from p3proxy listenqueue */
reset();
RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
RS_STACK_MUTEX(mSslMtx);
if (tou_bio) // this should be in the reset?
{
BIO_free(tou_bio);
}
return;
}
int pqissludp::reset_locked()
{
@ -449,15 +446,6 @@ int pqissludp::net_internal_fcntl_nonblock(int /*fd*/)
}
/* These are identical to pqinetssl version */
//int pqissludp::status()
int pqissludp::tick()
{
pqissl::tick();
return 1;
}
// listen fns call the udpproxy.
int pqissludp::listen()
{

View File

@ -61,7 +61,6 @@ virtual ~pqissludp();
// listen fns call the udpproxy.
virtual int listen();
virtual int stoplistening();
virtual int tick();
virtual bool connect_parameter(uint32_t type, uint32_t value);
virtual bool connect_additional_address(uint32_t type, const struct sockaddr_storage &addr);
@ -84,7 +83,10 @@ virtual int reset_locked();
virtual int Initiate_Connection();
virtual int Basic_Connection_Complete();
//protected internal fns that are overloaded for udp case.
/* Do we really need this ?
* It is very specific UDP+ToU+SSL stuff and unlikely to be reused.
* In fact we are overloading them here becase they are very do different of pqissl.
*/
virtual int net_internal_close(int fd);
virtual int net_internal_SSL_set_fd(SSL *ssl, int fd);
virtual int net_internal_fcntl_nonblock(int fd);
@ -93,9 +95,6 @@ private:
BIO *tou_bio; // specific to ssludp.
//int remote_timeout;
//int proxy_timeout;
long listen_checktime;
uint32_t mConnectPeriod;