aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_download.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-08-26 09:13:06 +0000
committerChristian Grothoff <christian@grothoff.org>2009-08-26 09:13:06 +0000
commit85172474808b86fb0b11d1f2a63a88d3741d5ecb (patch)
tree1e1896d46777a5699dbed2f1054af1be14f4c105 /src/fs/fs_download.c
parentfa64f260673f79b831269cebb500fb289439eb00 (diff)
downloadgnunet-85172474808b86fb0b11d1f2a63a88d3741d5ecb.tar.gz
gnunet-85172474808b86fb0b11d1f2a63a88d3741d5ecb.zip
hxing
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r--src/fs/fs_download.c75
1 files changed, 65 insertions, 10 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index cb3b39995..f1954ea89 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -18,22 +18,75 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20/** 20/**
21 * @file applications/fs/ecrs/download.c 21 * @file fs/fs_download.c
22 * @brief DOWNLOAD helper methods (which do the real work). 22 * @brief DOWNLOAD helper methods (which do the real work).
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 */ 24 */
25 25
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_protocols.h" 27#include "gnunet_fs_service.h"
28#include "gnunet_ecrs_lib.h"
29#include "gnunet_fs_lib.h"
30#include "gnunet_identity_lib.h"
31#include "ecrs_core.h"
32#include "ecrs.h"
33#include "fs.h" 28#include "fs.h"
34#include "tree.h"
35 29
36#define DEBUG_DOWNLOAD GNUNET_NO 30#define DEBUG_DOWNLOAD GNUNET_YES
31
32
33
34/**
35 * Download parts of a file. Note that this will store
36 * the blocks at the respective offset in the given file. Also, the
37 * download is still using the blocking of the underlying FS
38 * encoding. As a result, the download may *write* outside of the
39 * given boundaries (if offset and length do not match the 32k FS
40 * block boundaries). <p>
41 *
42 * This function should be used to focus a download towards a
43 * particular portion of the file (optimization), not to strictly
44 * limit the download to exactly those bytes.
45 *
46 * @param h handle to the file sharing subsystem
47 * @param uri the URI of the file (determines what to download); CHK or LOC URI
48 * @param filename where to store the file, maybe NULL (then no file is
49 * created on disk and data must be grabbed from the callbacks)
50 * @param offset at what offset should we start the download (typically 0)
51 * @param length how many bytes should be downloaded starting at offset
52 * @param anonymity anonymity level to use for the download
53 * @param no_temporaries set to GNUNET_YES to disallow generation of temporary files
54 * @param recursive should this be a recursive download (useful for directories
55 * to automatically trigger download of files in the directories)
56 * @param parent parent download to associate this download with (use NULL
57 * for top-level downloads; useful for manually-triggered recursive downloads)
58 * @return context that can be used to control this download
59 */
60struct GNUNET_FS_DownloadContext *
61GNUNET_FS_file_download_start (struct GNUNET_FS_Handle *h,
62 const struct GNUNET_FS_Uri *uri,
63 const char *filename,
64 unsigned long long offset,
65 unsigned long long length,
66 unsigned int anonymity,
67 int no_temporaries,
68 int recursive,
69 struct GNUNET_FS_DownloadContext *parent)
70{
71 return NULL;
72}
73
74/**
75 * Stop a download (aborts if download is incomplete).
76 *
77 * @param rm handle for the download
78 * @param do_delete delete files of incomplete downloads
79 */
80void
81GNUNET_FS_file_download_stop (struct GNUNET_FS_DownloadContext *rm,
82 int do_delete)
83{
84}
85
86
87
88
89#if 0
37 90
38/** 91/**
39 * Node-specific data (not shared, keep small!). 152 bytes. 92 * Node-specific data (not shared, keep small!). 152 bytes.
@@ -920,4 +973,6 @@ GNUNET_ECRS_file_download (struct GNUNET_GE_Context *ectx,
920 dpcb, dpcbClosure, tt, ttClosure); 973 dpcb, dpcbClosure, tt, ttClosure);
921} 974}
922 975
923/* end of download.c */ 976#endif
977
978/* end of fs_download.c */