mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
- removed _sharing_strategy and the methods that go with it, as its behavior is handled by the sessionEnabled() method
- added generic tunnel data item, along with item priority consts. Serialization still missing. - added new class for turtle client services, and entry point methods. - removed file name and file size ffrom _outgoing_file_hashes and _incoming_file_hashes. They are not needed. - changed some names to more generic ones. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-GenericTunneling@6285 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3bf08d809b
commit
270abcdc94
10 changed files with 349 additions and 272 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <vector>
|
||||
|
||||
class LinearizedExpression ;
|
||||
class RsTurtleClientService ;
|
||||
|
||||
class RsTurtle;
|
||||
extern RsTurtle *rsTurtle ;
|
||||
|
@ -83,8 +84,6 @@ class TurtleTrafficStatisticsInfo
|
|||
class RsTurtle
|
||||
{
|
||||
public:
|
||||
enum FileSharingStrategy { SHARE_ENTIRE_NETWORK, SHARE_FRIENDS_ONLY } ;
|
||||
|
||||
RsTurtle() {}
|
||||
virtual ~RsTurtle() {}
|
||||
|
||||
|
@ -103,23 +102,27 @@ class RsTurtle
|
|||
virtual TurtleRequestId turtleSearch(const std::string& match_string) = 0 ;
|
||||
virtual TurtleRequestId turtleSearch(const LinearizedExpression& expr) = 0 ;
|
||||
|
||||
// Sets the file sharing strategy. It concerns all local files. It would
|
||||
// be better to handle this for each file, of course.
|
||||
|
||||
void setFileSharingStrategy(FileSharingStrategy f) { _sharing_strategy = f ; }
|
||||
|
||||
// Initiates tunnel handling for the given file hash. tunnels. Launches
|
||||
// an exception if an error occurs during the initialization process. The
|
||||
// turtle router itself does not initiate downloads, it only maintains
|
||||
// tunnels for the given hash. The download should be driven by the file
|
||||
// transfer module by calling ftServer::FileRequest().
|
||||
//
|
||||
virtual void monitorFileTunnels(const std::string& name,const std::string& file_hash,uint64_t size) = 0 ;
|
||||
virtual void monitorTunnels(const std::string& file_hash) = 0 ;
|
||||
|
||||
// Tells the turtle router to stop handling tunnels for the given file hash. Traditionally this should
|
||||
// be called after calling ftServer::fileCancel().
|
||||
//
|
||||
virtual void stopMonitoringFileTunnels(const std::string& file_hash) = 0 ;
|
||||
virtual void stopMonitoringTunnels(const std::string& file_hash) = 0 ;
|
||||
|
||||
/// Adds a client tunnel service. This means that the service will be added
|
||||
/// to the list of services that might respond to tunnel requests.
|
||||
/// Example tunnel services include:
|
||||
///
|
||||
/// p3ChatService: tunnels correspond to private distant chatting
|
||||
/// ftServer : tunnels correspond to file data transfer
|
||||
///
|
||||
virtual void registerTunnelService(RsTurtleClientService *service) = 0;
|
||||
|
||||
// Get info from the turtle router. I use std strings to hide the internal structs.
|
||||
//
|
||||
|
@ -136,8 +139,6 @@ class RsTurtle
|
|||
// Hardcore handles
|
||||
virtual void setMaxTRForwardRate(int max_tr_up_rate) = 0 ;
|
||||
virtual int getMaxTRForwardRate() const = 0 ;
|
||||
protected:
|
||||
FileSharingStrategy _sharing_strategy ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue