mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 09:05:34 -05:00
Added missing functions to connectMgr.
Some debugging (which should be #ifdefd ) Removed old make.opt git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@691 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8df643596e
commit
cf7d072a5b
@ -1,249 +0,0 @@
|
|||||||
####
|
|
||||||
#Define OS.
|
|
||||||
#
|
|
||||||
OS = Linux
|
|
||||||
#OS = Cygwin
|
|
||||||
#OS = Win # MinGw.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
###########################################################################
|
|
||||||
###########################################################################
|
|
||||||
# Please Define these Variables before Compiling. (Examples below:)
|
|
||||||
# Linux (SSL_DIR & KADC_DIR)
|
|
||||||
# Cygwin (SSL_DIR & KADC_DIR & FLTK_DIR & PTHREADS_DIR)
|
|
||||||
# MinGW (SSL_DIR & KADC_DIR & FLTK_DIR & PTHREADS_DIR)
|
|
||||||
|
|
||||||
#### Linux/Cygwin Parameters.
|
|
||||||
#SSL_DIR=/home/xxx/prog/src/openssl-0.9.7g-xpgp-0.1c
|
|
||||||
#KADC_DIR=/home/xxx/prog/src/KadC
|
|
||||||
#
|
|
||||||
#### Cygwin Only....
|
|
||||||
#FLTK_DIR=/MinGWlibs/FLTK-1.1.6
|
|
||||||
#PTHREADS_DIR=/cygdrive/c/home/dev/prog/MinGw/pthreads/Pre-built.2
|
|
||||||
#KADC_DIR=/cygdrive/c/home/dev/prog/MinGW/KadC
|
|
||||||
#ZLIB_DIR=/cygdrive/c/home/dev/prog/MinGW/zlib-1.2.3
|
|
||||||
#
|
|
||||||
###########################################################################
|
|
||||||
# My Versions
|
|
||||||
ifeq ($(OS),Linux)
|
|
||||||
#Linux.
|
|
||||||
SSL_DIR=../../../../../src/openssl-0.9.7g-xpgp-0.1c
|
|
||||||
KADC_DIR=../../../../../src/KadC
|
|
||||||
UPNPC_DIR=../../../../../src/miniupnpc-20070515
|
|
||||||
else
|
|
||||||
###########################################################################
|
|
||||||
ifeq ($(OS),Cygwin)
|
|
||||||
|
|
||||||
#Cygwin....
|
|
||||||
CYGWIN_SRC_ROOT=/cygdrive/c/home/rmfern/prog/MinGW
|
|
||||||
SSL_DIR=/home/rmfern/prog/src/openssl-0.9.7g
|
|
||||||
#SSL_DIR=$(CYGWIN_SRC_ROOT)/openssl-0.9.7g
|
|
||||||
FLTK_DIR=$(CYGWIN_SRC_ROOT)/FLTK-1.1.6
|
|
||||||
PTHREADS_DIR=$(CYGWIN_SRC_ROOT)/pthreads/pthreads.2
|
|
||||||
KADC_DIR=$(CYGWIN_SRC_ROOT)/debug/KadC-2006-Oct-19
|
|
||||||
ZLIB_DIR=$(CYGWIN_SRC_ROOT)/zlib-1.2.3
|
|
||||||
UPNPC_DIR=$(CYGWIN_SRC_ROOT)/libs/src/miniupnpc-20070515
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
#MinGw....
|
|
||||||
MINGW_SRC_ROOT=c:\home\rmfern\prog\MinGW
|
|
||||||
SSL_DIR=$(MINGW_SRC_ROOT)\openssl-0.9.7g
|
|
||||||
FLTK_DIR=$(MINGW_SRC_ROOT)\FLTK-1.1.6
|
|
||||||
PTHREADS_DIR=$(MINGW_SRC_ROOT)\pthreads\pthreads.2
|
|
||||||
KADC_DIR=$(MINGW_SRC_ROOT)\debug\KadC-2006-Oct-19
|
|
||||||
ZLIB_DIR=$(MINGW_SRC_ROOT)\zlib-1.2.3
|
|
||||||
UPNPC_DIR=$(MINGW_SRC_ROOT)\miniupnpc-20070515
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
###########################################################################
|
|
||||||
endif
|
|
||||||
###########################################################################
|
|
||||||
|
|
||||||
ifndef RS_TOP_DIR
|
|
||||||
dummy:
|
|
||||||
echo "RS_TOP_DIR is not defined in your makefile"
|
|
||||||
endif
|
|
||||||
|
|
||||||
RS_DIR=$(RS_TOP_DIR)
|
|
||||||
|
|
||||||
ifndef SSL_DIR
|
|
||||||
dummy:
|
|
||||||
echo "you must define SSL_DIR before you can compile"
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef KADC_DIR
|
|
||||||
dummy:
|
|
||||||
echo "you must define KADC_DIR before you can compile"
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(OS),Linux)
|
|
||||||
# no longer dependancy
|
|
||||||
# ifndef FLTK_DIR
|
|
||||||
#dummy:
|
|
||||||
# echo "you must define FLTK_DIR before you can compile"
|
|
||||||
|
|
||||||
# endif
|
|
||||||
#
|
|
||||||
ifndef PTHREADS_DIR
|
|
||||||
dummy:
|
|
||||||
echo "you must define PTHREADS_DIR before you can compile"
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
############ ENFORCE DIRECTORY NAMING ########################
|
|
||||||
|
|
||||||
CC = g++
|
|
||||||
|
|
||||||
|
|
||||||
# flags for components....
|
|
||||||
PQI_USE_XPGP = 1
|
|
||||||
#PQI_USE_PROXY = 1
|
|
||||||
#PQI_USE_CHANNELS = 1
|
|
||||||
USE_FILELOOK = 1
|
|
||||||
|
|
||||||
ifeq ($(OS),Win)
|
|
||||||
# MinGw
|
|
||||||
INCLUDE = -I $(RS_DIR) -I$(KADC_DIR)
|
|
||||||
ifdef PQI_USE_XPGP
|
|
||||||
INCLUDE += -I $(SSL_DIR)\include
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
# Unix: Linux/Cygwin
|
|
||||||
INCLUDE = -I $(RS_DIR) -I$(KADC_DIR)
|
|
||||||
ifdef PQI_USE_XPGP
|
|
||||||
INCLUDE += -I $(SSL_DIR)/include
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS = -Wall -g $(INCLUDE)
|
|
||||||
|
|
||||||
RANLIB = ranlib
|
|
||||||
LIBRS = ../lib/libretroshare.a
|
|
||||||
RSCFLAGS = -Wall -g $(INCLUDE)
|
|
||||||
|
|
||||||
ifdef PQI_USE_XPGP
|
|
||||||
CFLAGS += -DPQI_USE_XPGP
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef PQI_USE_PROXY
|
|
||||||
CFLAGS += -DPQI_USE_PROXY
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef PQI_USE_CHANNELS
|
|
||||||
CFLAGS += -DPQI_USE_CHANNELS
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef USE_FILELOOK
|
|
||||||
CFLAGS += -DUSE_FILELOOK
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
# OS specific Includes/Libs.
|
|
||||||
# LINUX...
|
|
||||||
ifeq ($(OS),Linux)
|
|
||||||
|
|
||||||
|
|
||||||
# XLIBS arent needed for basic libretroshare.
|
|
||||||
# only needed for FLTK interface.
|
|
||||||
|
|
||||||
#XLIB = -lXft -lpthread -lXext -lX11 \
|
|
||||||
# -lXrender -lexpat -L/usr/X11R6/lib -lXau \
|
|
||||||
# -lXinerama -lXdmcp -lXext \
|
|
||||||
# -lfontconfig -lfreetype -lz
|
|
||||||
|
|
||||||
RM = /bin/rm
|
|
||||||
|
|
||||||
LIBDIR = $(RS_DIR)/lib
|
|
||||||
LIBS = -L$(LIBDIR) -lretroshare
|
|
||||||
ifdef PQI_USE_XPGP
|
|
||||||
LIBS += -L$(SSL_DIR)
|
|
||||||
endif
|
|
||||||
LIBS += -lssl -lcrypto -lpthread
|
|
||||||
LIBS += -L$(KADC_DIR) -lKadC
|
|
||||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
|
||||||
LIBS += $(XLIB) -ldl -lz
|
|
||||||
|
|
||||||
RSLIBS = $(LIBS)
|
|
||||||
|
|
||||||
else # windows (Cygwin or MinGW)
|
|
||||||
|
|
||||||
# for static pthread libs....
|
|
||||||
WININC += -DPTW32_STATIC_LIB
|
|
||||||
WINLIB = -lws2_32 -luuid -lole32 -liphlpapi
|
|
||||||
|
|
||||||
ifeq ($(OS),Cygwin)
|
|
||||||
# Cygwin
|
|
||||||
WININC += -mno-cygwin -mwindows -fno-exceptions -fomit-frame-pointer -DWINDOWS_SYS
|
|
||||||
WINLIB += -lcrypt32
|
|
||||||
|
|
||||||
# Cygwin
|
|
||||||
#CFLAGS += -I$(FLTK_DIR)/include
|
|
||||||
CFLAGS += -I$(PTHREADS_DIR) $(WININC)
|
|
||||||
CFLAGS += -I$(ZLIB_DIR)
|
|
||||||
|
|
||||||
LIBDIR = $(RS_DIR)/lib
|
|
||||||
LIBS = -L$(LIBDIR) -lretroshare
|
|
||||||
ifdef PQI_USE_XPGP
|
|
||||||
LIBS += -L$(SSL_DIR)
|
|
||||||
endif
|
|
||||||
LIBS += -lssl -lcrypto
|
|
||||||
LIBS += -L$(KADC_DIR) -lKadC
|
|
||||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
|
||||||
LIBS += -L$(ZLIB_DIR) -lz
|
|
||||||
|
|
||||||
RSLIBS += $(LIBS)
|
|
||||||
RSLIBS += -L$(PTHREADS_DIR) -lpthreadGC2d
|
|
||||||
|
|
||||||
RSLIBS += $(WINLIB)
|
|
||||||
LIBS += $(WINLIB)
|
|
||||||
|
|
||||||
|
|
||||||
RSCFLAGS += $(WININC)
|
|
||||||
|
|
||||||
RM = /bin/rm
|
|
||||||
|
|
||||||
else # MinGw.
|
|
||||||
|
|
||||||
#WININC += -mwindows -fno-exceptions -fomit-frame-pointer -DWINDOWS_SYS
|
|
||||||
WININC += -frtti -fexceptions -DWINDOWS_SYS
|
|
||||||
WINLIB += -lcrypt32-cygwin
|
|
||||||
|
|
||||||
# Cygwin
|
|
||||||
CFLAGS += -I$(PTHREADS_DIR) $(WININC)
|
|
||||||
CFLAGS += -I$(ZLIB_DIR)
|
|
||||||
#CFLAGS += -I$(FLTK_DIR)\include
|
|
||||||
|
|
||||||
LIBDIR = $(RS_DIR)\lib
|
|
||||||
LIBS = -L$(LIBDIR) -lretroshare
|
|
||||||
ifdef PQI_USE_XPGP
|
|
||||||
LIBS += -L$(SSL_DIR)
|
|
||||||
endif
|
|
||||||
LIBS += -lssl -lcrypto
|
|
||||||
LIBS += -L$(KADC_DIR) -lKadC
|
|
||||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
|
||||||
LIBS += -L$(ZLIB_DIR) -lz
|
|
||||||
|
|
||||||
RSLIBS = $(LIBS)
|
|
||||||
RSLIBS += -L$(PTHREADS_DIR) -lpthreadGC2d
|
|
||||||
|
|
||||||
LIBS += $(WINLIB)
|
|
||||||
RSLIBS += $(WINLIB)
|
|
||||||
|
|
||||||
|
|
||||||
RSCFLAGS += $(WININC)
|
|
||||||
|
|
||||||
RM = del
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3013,6 +3013,12 @@ bool p3ConnectMgr::addBootstrapStunPeers()
|
|||||||
/************************ INTERFACES ***********************/
|
/************************ INTERFACES ***********************/
|
||||||
|
|
||||||
|
|
||||||
|
void p3ConnectMgr::addNetAssistFirewall(uint32_t id, pqiNetAssistFirewall *fwAgent)
|
||||||
|
{
|
||||||
|
mFwAgents[id] = fwAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool p3ConnectMgr::enableNetAssistFirewall(bool on)
|
bool p3ConnectMgr::enableNetAssistFirewall(bool on)
|
||||||
{
|
{
|
||||||
std::map<uint32_t, pqiNetAssistFirewall *>::iterator it;
|
std::map<uint32_t, pqiNetAssistFirewall *>::iterator it;
|
||||||
@ -3088,6 +3094,12 @@ bool p3ConnectMgr::netAssistExtAddress(struct sockaddr_in &extAddr)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void p3ConnectMgr::addNetAssistConnect(uint32_t id, pqiNetAssistConnect *dht)
|
||||||
|
{
|
||||||
|
mDhts[id] = dht;
|
||||||
|
}
|
||||||
|
|
||||||
bool p3ConnectMgr::enableNetAssistConnect(bool on)
|
bool p3ConnectMgr::enableNetAssistConnect(bool on)
|
||||||
{
|
{
|
||||||
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
|
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
|
||||||
@ -3197,6 +3209,21 @@ bool p3ConnectMgr::netAssistSetAddress( struct sockaddr_in &laddr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool p3ConnectMgr::getUPnPState()
|
||||||
|
{
|
||||||
|
return netAssistFirewallActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3ConnectMgr::getUPnPEnabled()
|
||||||
|
{
|
||||||
|
return netAssistFirewallEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3ConnectMgr::getDHTEnabled()
|
||||||
|
{
|
||||||
|
return netAssistConnectEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,6 +144,15 @@ bool p3Files::FileControl(std::string hash, uint32_t flags)
|
|||||||
bool p3Files::FileRequest(std::string fname, std::string hash, uint32_t size,
|
bool p3Files::FileRequest(std::string fname, std::string hash, uint32_t size,
|
||||||
std::string dest, uint32_t flags, std::list<std::string> srcIds)
|
std::string dest, uint32_t flags, std::list<std::string> srcIds)
|
||||||
{
|
{
|
||||||
|
std::cerr << "p3Files::FileRequest()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "name:" << fname;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "size:" << size;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "dest:" << dest;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
lockRsCore(); /* LOCKED */
|
lockRsCore(); /* LOCKED */
|
||||||
|
|
||||||
std::cerr << "p3Files::FileRequest(" << fname << ", ";
|
std::cerr << "p3Files::FileRequest(" << fname << ", ";
|
||||||
@ -152,6 +161,8 @@ bool p3Files::FileRequest(std::string fname, std::string hash, uint32_t size,
|
|||||||
int ret = mServer -> getFile(fname, hash, size, dest);
|
int ret = mServer -> getFile(fname, hash, size, dest);
|
||||||
|
|
||||||
unlockRsCore(); /* UNLOCKED */
|
unlockRsCore(); /* UNLOCKED */
|
||||||
|
std::cerr << "p3Files::FileRequest() Done";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user