diff --git a/build_scripts/Ubuntu/make.sh b/build_scripts/Ubuntu/make.sh index 41a497058..1a6b6374d 100755 --- a/build_scripts/Ubuntu/make.sh +++ b/build_scripts/Ubuntu/make.sh @@ -1,7 +1,7 @@ #!/bin/sh ###################### PARAMETERS #################### -version="0.4.12" +version="0.5-alpha1" arch=`dpkg --print-architecture` packager="Cyril Soler " ###################################################### @@ -11,14 +11,15 @@ svn=`svn info | grep 'Revision:' | cut -d\ -f2` echo done. version="$version"."$svn" pkgname=RetroShare_"$version"_ubuntu_"$arch".deb +rsdir="../.." echo Building retroshare debian package version $version for Ubuntu $arch. echo Please check that: echo " "- you have sudo access and that root has right to write in this directory and the subdirectories. -echo " "- you have compiled libretroshare and retroshare-gui in ../../libretroshare/src/ -echo " "and ../../retroshare-gui/src/ -echo " "- you have updated version numbers in ../../retroshare-gui/src/util/rsversion.cpp -echo " "and ../../retroshare-gui/src/retroshare.nsi +echo " "- you have compiled libretroshare and retroshare-gui in "$rsdir"/libretroshare/src/ +echo " "and "$rsdir"/retroshare-gui/src/ +echo " "- you have updated version numbers in "$rsdir"/retroshare-gui/src/util/rsversion.cpp +echo " "and "$rsdir"/retroshare-gui/src/retroshare.nsi echo " "- version and name will be: $pkgname if ! test `whoami` = "root" ; then @@ -47,22 +48,22 @@ mv retroshare/DEBIAN/control.tmp retroshare/DEBIAN/control find retroshare -name "*~" -exec \rm -f {} \; # copy executables at the right place -if ! test -f ../../retroshare-gui/src/RetroShare; then - echo Can not find executable ../../retroshare-gui/src/RetroShare. Please fix this. - echo - exit ; -fi -if ! test -f ../../retroshare-nogui/src/retroshare-nogui; then - echo Can not find executable ../../retroshare-nogui/src/retroshare-nogui. Please fix this. +if ! test -f "$rsdir"/retroshare-gui/src/RetroShare; then + echo Can not find executable "$rsdir"/retroshare-gui/src/RetroShare. Please fix this. echo exit ; fi +#if ! test -f "$rsdir"/retroshare-nogui/src/retroshare-nogui; then +# echo Can not find executable "$rsdir"/retroshare-nogui/src/retroshare-nogui. Please fix this. +# echo +# exit ; +#fi echo Stripping executables... -cp ../../retroshare-gui/src/RetroShare retroshare/usr/bin/ +cp "$rsdir"/retroshare-gui/src/RetroShare retroshare/usr/bin/ strip retroshare/usr/bin/RetroShare -cp ../../retroshare-nogui/src/retroshare-nogui retroshare/usr/bin/ -strip retroshare/usr/bin/retroshare-nogui +#cp ../../retroshare-nogui/src/retroshare-nogui retroshare/usr/bin/ +#strip retroshare/usr/bin/retroshare-nogui # compute md5 sums echo Computing/setting md5 sums... diff --git a/build_scripts/Ubuntu_src/BaseRetroShareDirs.tgz b/build_scripts/Ubuntu_src/BaseRetroShareDirs.tgz index b85b6fcbf..f20c9fee4 100644 Binary files a/build_scripts/Ubuntu_src/BaseRetroShareDirs.tgz and b/build_scripts/Ubuntu_src/BaseRetroShareDirs.tgz differ diff --git a/build_scripts/Ubuntu_src/make.sh b/build_scripts/Ubuntu_src/make.sh index d71962281..69d94d21f 100755 --- a/build_scripts/Ubuntu_src/make.sh +++ b/build_scripts/Ubuntu_src/make.sh @@ -15,3 +15,4 @@ rm -rf ./retroshare-0.5 sudo pbuilder build *.dsc +cp /var/cache/pbuilder/result/retroshare_0.5-1_i386.deb . diff --git a/build_scripts/Ubuntu_src/makeSourcePackage.sh b/build_scripts/Ubuntu_src/makeSourcePackage.sh index d101d8cb1..68bb03a99 100755 --- a/build_scripts/Ubuntu_src/makeSourcePackage.sh +++ b/build_scripts/Ubuntu_src/makeSourcePackage.sh @@ -5,10 +5,27 @@ if test -d "RetroShare" ; then exit fi + +###################### PARAMETERS #################### +version="0.5-alpha1" +###################################################### + +echo attempting to get svn revision number... +svn=`svn info | grep 'Revision:' | cut -d\ -f2` +echo done. +version="$version"."$svn" +echo got version number $version. Is this correct ? +read tmp + packages="." tar zxvf $packages/BaseRetroShareDirs.tgz +echo Setting up version numbers... +cat retroshare-0.5/debian/control | sed -e s/XXXXXX/"$version"/g | sed -e s/YYYYYY/"$arch"/g | sed -e s/ZZZZZZ/"$packager"/g > retroshare-0.5/debian/control.tmp +mv retroshare-0.5/debian/control.tmp retroshare-0.5/debian/control + +echo Getting svn sources # Ultimately, use the following, but cd retroshare-0.5/src/libretroshare/ #tar zxvf ../../../libretroshare.tgz @@ -22,8 +39,10 @@ cd ../../.. # Various cleaning +echo Cleaning... find retroshare-0.5 -name ".svn" -exec rm -rf {} \; # remove all svn repositories +echo Preparing package mv retroshare-0.5/src/retroshare-gui/RetroShare.pro retroshare-0.5/src/retroshare-gui/retroshare-gui.pro ./cleanProFile.sh retroshare-0.5/src/libretroshare/libretroshare.pro diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 28c7c2f77..19c009ba1 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -550,12 +550,18 @@ void ftController::locked_checkQueueElement(uint32_t pos) if(pos < _max_active_downloads) { _queue[pos]->mState = ftFileControl::DOWNLOADING ; + + if(_queue[pos]->mFlags & RS_FILE_HINTS_NETWORK_WIDE) + mTurtle->monitorFileTunnels(_queue[pos]->mName,_queue[pos]->mHash,_queue[pos]->mSize) ; } if(pos >= _max_active_downloads && _queue[pos]->mState != ftFileControl::QUEUED) { _queue[pos]->mState = ftFileControl::QUEUED ; _queue[pos]->mCreator->closeFile() ; + + if(_queue[pos]->mFlags & RS_FILE_HINTS_NETWORK_WIDE) + mTurtle->stopMonitoringFileTunnels(_queue[pos]->mHash) ; } } diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index a16d2890d..c025c9f05 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -238,6 +238,9 @@ void p3turtle::autoWash() #endif // Remove hashes that are marked as such. // + + std::vector > peers_to_remove ; + { RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ @@ -270,7 +273,7 @@ void p3turtle::autoWash() std::cerr << ")" << std::endl ; #endif for(unsigned int k=0;kfirst) ; } for(unsigned int i=0;iremoveFileSource(peers_to_remove[i].first,peers_to_remove[i].second) ; + } -void p3turtle::locked_closeTunnel(TurtleTunnelId tid) +void p3turtle::locked_closeTunnel(TurtleTunnelId tid,std::vector >& sources_to_remove) { // This is closing a given tunnel, removing it from file sources, and from the list of tunnels of its // corresponding file hash. In the original turtle4privacy paradigm, they also send back and forward @@ -378,7 +386,7 @@ void p3turtle::locked_closeTunnel(TurtleTunnelId tid) std::cerr << " Virtual Peer Id " << vpid << std::endl ; std::cerr << " Associated file source." << std::endl ; #endif - _ft_controller->removeFileSource(hash,vpid) ; + sources_to_remove.push_back(std::pair(hash,vpid)) ; // Let's be cautious. Normally we should never be here without consistent information, // but still, this happens, rarely. @@ -1677,6 +1685,20 @@ void p3turtle::monitorFileTunnels(const std::string& name,const std::string& fil { RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ + // First, check if the hash is tagged for removal (there's a delay) + + for(uint i=0;i<_hashes_to_remove.size();++i) + if(_hashes_to_remove[i] == file_hash) + { + _hashes_to_remove[i] = _hashes_to_remove.back() ; + _hashes_to_remove.pop_back() ; +#ifdef P3TURTLE_DEBUG + std::cerr << "p3turtle: File hash " << file_hash << " Was scheduled for removal. Canceling the removal." << std::endl ; +#endif + } + + // Then, check if the hash is already there + // if(_incoming_file_hashes.find(file_hash) != _incoming_file_hashes.end()) // download already asked. { #ifdef P3TURTLE_DEBUG @@ -1730,7 +1752,7 @@ static std::string printNumber(uint64_t num,bool hex=false) if(num < (((uint64_t)1)<<32)) sprintf(tmp,"%08x", uint32_t(num)) ; else - sprintf(tmp,"%08x%08x", uint32_t(num >> 32),uint32_t(num & ( (1<<32)-1 ))) ; + sprintf(tmp,"%08x%08x", uint32_t(num >> 32),uint32_t(num & ( (((uint64_t)1)<<32)-1 ))) ; return std::string(tmp) ; } else diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index 05a7c870c..f51c59db4 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -311,8 +311,11 @@ class p3turtle: public p3Service, public pqiMonitor, public RsTurtle,/* public f /// Handle tunnel digging for current file hashes void manageTunnels() ; - /// closes a given tunnel. Should be called with mutex set. - void locked_closeTunnel(TurtleTunnelId tid) ; + /// Closes a given tunnel. Should be called with mutex set. + /// The hashes and peers to remove (by calling + /// ftController::removeFileSource() are happended to the supplied vector + /// so that they can be removed off the turtle mutex. + void locked_closeTunnel(TurtleTunnelId tid,std::vector >& peers_to_remove) ; /// Main routing function int handleIncoming(); diff --git a/libretroshare/src/util/rsversion.h b/libretroshare/src/util/rsversion.h index 538663482..43b6578c2 100644 --- a/libretroshare/src/util/rsversion.h +++ b/libretroshare/src/util/rsversion.h @@ -8,7 +8,7 @@ #include #define LIB_VERSION "0.5.0 alpha 1" -#define SVN_REVISION "svn : 2213 date : 21:41:59 02.06.10" +#define SVN_REVISION "Revision: 2519 date : 20:36:48 03.12.10" namespace RsUtil { diff --git a/retroshare-gui/src/gui/SearchDialog.cpp b/retroshare-gui/src/gui/SearchDialog.cpp index 4eca884f4..67412cff0 100644 --- a/retroshare-gui/src/gui/SearchDialog.cpp +++ b/retroshare-gui/src/gui/SearchDialog.cpp @@ -1210,6 +1210,7 @@ void SearchDialog::copysearchLink() RetroShareLink link(fname, fsize, fhash); + std::cerr << "new link added to clipboard: " << link.toString().toStdString() << std::endl ; if(link.valid()) urls.push_back(link.toUrl()) ; } diff --git a/retroshare-gui/src/gui/help/version.html b/retroshare-gui/src/gui/help/version.html index bf544a7db..0470acb60 100644 --- a/retroshare-gui/src/gui/help/version.html +++ b/retroshare-gui/src/gui/help/version.html @@ -1,5 +1,5 @@ Retroshare Gui version : -Svn version : Revision: 2398 -Tue Feb 23 16:33:19 GMT 2010 +Svn version : Revision: 2519 +Fri Mar 12 20:36:59 CET 2010 diff --git a/retroshare-gui/src/util/rsversion.h b/retroshare-gui/src/util/rsversion.h index d8dd018bb..3609c4333 100644 --- a/retroshare-gui/src/util/rsversion.h +++ b/retroshare-gui/src/util/rsversion.h @@ -22,7 +22,7 @@ #define GUI_VERSION "0.5.0 alpha 1" -#define GUI_REVISION "Revision: 2268 date : 18:57:43 02.09.10" +#define GUI_REVISION "Revision: 2519 date : 20:36:59 03.12.10" #include diff --git a/retroshare-nogui/src/retroshare-nogui.pro b/retroshare-nogui/src/retroshare-nogui.pro index e67d47617..c57c8fa29 100644 --- a/retroshare-nogui/src/retroshare-nogui.pro +++ b/retroshare-nogui/src/retroshare-nogui.pro @@ -10,7 +10,7 @@ linux-g++ { LIBS += ../../../../lib/linux-g++/libminiupnpc.a LIBS += ../../../../lib/linux-g++/libssl.a LIBS += ../../../../lib/linux-g++/libcrypto.a - LIBS += -lz + LIBS += -lpthread -lz } linux-g++-64 { OBJECTS_DIR = temp/linux-g++-64/obj