diff --git a/libretroshare/src/file_sharing/README.txt b/libretroshare/src/file_sharing/README.txt index f5e298afc..19a24db43 100644 --- a/libretroshare/src/file_sharing/README.txt +++ b/libretroshare/src/file_sharing/README.txt @@ -87,6 +87,20 @@ Generating sync events * Server side - 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 ------- @@ -99,3 +113,30 @@ Roadmap - optionally - 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 + + + + + + + + + + + + + + + + + + + diff --git a/libretroshare/src/file_sharing/directory_list.h b/libretroshare/src/file_sharing/directory_list.h new file mode 100644 index 000000000..c643b6153 --- /dev/null +++ b/libretroshare/src/file_sharing/directory_list.h @@ -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 ; +}; diff --git a/libretroshare/src/file_sharing/directory_updater.h b/libretroshare/src/file_sharing/directory_updater.h new file mode 100644 index 000000000..be59eb987 --- /dev/null +++ b/libretroshare/src/file_sharing/directory_updater.h @@ -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 +{ +}; diff --git a/libretroshare/src/file_sharing/p3filelists.h b/libretroshare/src/file_sharing/p3filelists.h new file mode 100644 index 000000000..7bddccc53 --- /dev/null +++ b/libretroshare/src/file_sharing/p3filelists.h @@ -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() ; + + +}; + diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index d01d4c9dd..13b315713 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -354,6 +354,10 @@ HEADERS += ft/ftchunkmap.h \ ft/fttransfermodule.h \ ft/ftturtlefiletransferitem.h +HEADERS += directory_updater.h \ + directory_list.h \ + p3filelists.h + HEADERS += chat/distantchat.h \ chat/p3chatservice.h \ chat/distributedchat.h \