Fixed upnp issues

* Removed periodic Check and thread.
 * Added Shutdown.
 * switched to terminating background thread.
 * removed temporary lease.
 * A bit of a HACK - this class could be cleaned up significantly.

Adding the start of forums/channels.
 * Dummy Interface and Forum data (so GUI work can start)
 * rough p3distrib - needs a lot of work.

Added shutdown function to p3connmgr, to shutdown Upnp.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@493 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-04-09 12:54:15 +00:00
parent 20c9e7d224
commit 94371600be
16 changed files with 2007 additions and 233 deletions

View file

@ -52,6 +52,7 @@ virtual ~upnphandler();
/* External Interface */
virtual void enableUPnP(bool active);
virtual void shutdownUPnP();
virtual void restartUPnP();
virtual bool getUPnPEnabled();
virtual bool getUPnPActive();
@ -61,25 +62,24 @@ virtual void setExternalPort(unsigned short eport_in);
virtual bool getInternalAddress(struct sockaddr_in &addr);
virtual bool getExternalAddress(struct sockaddr_in &addr);
/* must run thread */
virtual void run();
/* Public functions - for background thread operation,
* but effectively private from rest of RS, as in derived class
*/
bool start_upnp();
bool shutdown_upnp();
bool initUPnPState();
bool printUPnPState();
private:
bool initUPnPState();
void checkUPnPState();
bool printUPnPState();
bool background_setup_upnp(bool, bool);
bool checkUPnPActive();
bool updateUPnP();
/* Mutex for data below */
RsMutex dataMtx;
/* requested from rs */
bool toShutdown; /* if set shuts down the thread. */
bool toEnable; /* overall on/off switch */
bool toStart; /* if set start forwarding */
bool toStop; /* if set stop forwarding */