mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-01 19:31:27 -05:00
basic bits of new file list sharing system
This commit is contained in:
parent
0c474f9283
commit
89af650f74
@ -87,6 +87,20 @@ Generating sync events
|
|||||||
* Server side
|
* Server side
|
||||||
- after a change, broadcast a "directory changed" packet to all connected friends
|
- after a change, broadcast a "directory changed" packet to all connected friends
|
||||||
|
|
||||||
|
|
||||||
|
DirectoryWatcher (watches a hierarchy) File List (stores a directory hierarchy)
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
+-----------------------+------------------+
|
||||||
|
| |
|
||||||
|
Shared File Service |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
+----------- own file list -------+---------- Encrypted/compressed save to disk
|
||||||
|
| | |
|
||||||
|
+----------- friend file lists ---+
|
||||||
|
|
||||||
Roadmap
|
Roadmap
|
||||||
-------
|
-------
|
||||||
|
|
||||||
@ -99,3 +113,30 @@ Roadmap
|
|||||||
- optionally
|
- optionally
|
||||||
- change the saving system of FileIndex to make it locally encrypted and compact
|
- change the saving system of FileIndex to make it locally encrypted and compact
|
||||||
|
|
||||||
|
TODO
|
||||||
|
====
|
||||||
|
[ ] implement directory updater
|
||||||
|
[ ] local directory updater
|
||||||
|
[ ] remote directory updater
|
||||||
|
|
||||||
|
[ ] implement directory handler
|
||||||
|
[ ] implement p3FileLists with minimal functonality: no exchange. Only storage of own
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
13
libretroshare/src/file_sharing/directory_list.h
Normal file
13
libretroshare/src/file_sharing/directory_list.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// This class keeps a shared directory. It's quite the equivalent of the old "FileIndex" class
|
||||||
|
// The main difference is that it is
|
||||||
|
// - extensible
|
||||||
|
// - fast to search (at least for hashes). Should provide possibly multiple search handles for
|
||||||
|
// the same file, e.g. if connexion is encrypted.
|
||||||
|
// - abstracts the browsing in a same manner.
|
||||||
|
//
|
||||||
|
class SharedDirectoryList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
DirEntry mRoot ;
|
||||||
|
};
|
25
libretroshare/src/file_sharing/directory_updater.h
Normal file
25
libretroshare/src/file_sharing/directory_updater.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// This class crawls the given directry hierarchy and updates it. It does so by calling the
|
||||||
|
// shared file list source. This source may be of two types:
|
||||||
|
// - local: directories are crawled n disk and files are hashed / requested from a cache
|
||||||
|
// - remote: directories are requested remotely to a providing client
|
||||||
|
//
|
||||||
|
class DirectoryUpdater
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DirectoryUpdater() ;
|
||||||
|
|
||||||
|
// Does some updating job. Crawls the existing directories and checks wether it has been updated
|
||||||
|
// recently enough. If not, calls the directry source.
|
||||||
|
//
|
||||||
|
void tick() ;
|
||||||
|
|
||||||
|
//
|
||||||
|
};
|
||||||
|
|
||||||
|
class LocalDirectoryUpdater: public DirectoryUpdater
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
class RemoteDirectoryUpdater: public DirectoryUpdater
|
||||||
|
{
|
||||||
|
};
|
29
libretroshare/src/file_sharing/p3filelists.h
Normal file
29
libretroshare/src/file_sharing/p3filelists.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// This class is responsible for
|
||||||
|
// - maintaining a list of shared file hierarchies for each known friends
|
||||||
|
// - talking to the GUI
|
||||||
|
// - providing handles for the directory tree listing GUI
|
||||||
|
// - providing search handles for FT
|
||||||
|
// - keeping these lists up to date
|
||||||
|
// - sending our own file list to friends depending on the defined access rights
|
||||||
|
// - serving file search requests from other services such as file transfer
|
||||||
|
//
|
||||||
|
// p3FileList does the following micro-tasks:
|
||||||
|
// - tick the watchers
|
||||||
|
// - get incoming info from the service layer, which can be:
|
||||||
|
// - directory content request => the directory content is shared to the friend
|
||||||
|
// - directory content => the directory watcher is notified
|
||||||
|
// - keep two queues of update requests:
|
||||||
|
// - fast queue that is handled in highest priority. This one is used for e.g. updating while browsing.
|
||||||
|
// - slow queue that is handled slowly. Used in background update of shared directories.
|
||||||
|
//
|
||||||
|
// The file lists are not directry updated. A FileListWatcher class is responsible for this
|
||||||
|
// in every case.
|
||||||
|
//
|
||||||
|
class p3FileLists: public p3Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
p3FileLists() ;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
@ -354,6 +354,10 @@ HEADERS += ft/ftchunkmap.h \
|
|||||||
ft/fttransfermodule.h \
|
ft/fttransfermodule.h \
|
||||||
ft/ftturtlefiletransferitem.h
|
ft/ftturtlefiletransferitem.h
|
||||||
|
|
||||||
|
HEADERS += directory_updater.h \
|
||||||
|
directory_list.h \
|
||||||
|
p3filelists.h
|
||||||
|
|
||||||
HEADERS += chat/distantchat.h \
|
HEADERS += chat/distantchat.h \
|
||||||
chat/p3chatservice.h \
|
chat/p3chatservice.h \
|
||||||
chat/distributedchat.h \
|
chat/distributedchat.h \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user