diff options
Diffstat (limited to 'src/fs/fs.c')
-rw-r--r-- | src/fs/fs.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/fs/fs.c b/src/fs/fs.c index 0522b7941..157f4ef22 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include "fs.h" | 29 | #include "fs.h" |
30 | 30 | ||
31 | 31 | ||
32 | |||
33 | /** | 32 | /** |
34 | * Setup a connection to the file-sharing service. | 33 | * Setup a connection to the file-sharing service. |
35 | * | 34 | * |
@@ -46,7 +45,35 @@ GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched, | |||
46 | GNUNET_FS_ProgressCallback upcb, | 45 | GNUNET_FS_ProgressCallback upcb, |
47 | void *upcb_cls) | 46 | void *upcb_cls) |
48 | { | 47 | { |
49 | return NULL; | 48 | struct GNUNET_FS_Handle *ret; |
49 | struct GNUNET_CLIENT_Connection *client; | ||
50 | |||
51 | client = GNUNET_CLIENT_connect (sched, | ||
52 | "fs", | ||
53 | cfg); | ||
54 | if (NULL == client) | ||
55 | return NULL; | ||
56 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Handle)); | ||
57 | ret->sched = sched; | ||
58 | ret->cfg = cfg; | ||
59 | ret->client_name = GNUNET_strdup (client_name); | ||
60 | ret->upcb = upcb; | ||
61 | ret->upcb_cls = upcb_cls; | ||
62 | ret->client = client; | ||
63 | // FIXME: setup receive-loop with client | ||
64 | // FIXME: deserialize state; use client-name to find master-directory! | ||
65 | // Deserialize-Upload: | ||
66 | // * read FNs for upload FIs, deserialize each | ||
67 | // Deserialize Search: | ||
68 | // * read search queries | ||
69 | // * for each query, read file with search results | ||
70 | // * for each search result with active download, deserialize download | ||
71 | // * for each directory search result, check for active downloads of contents | ||
72 | // Deserialize Download: | ||
73 | // * always part of search??? | ||
74 | // Deserialize Unindex: | ||
75 | // * read FNs for unindex with progress offset | ||
76 | return ret; | ||
50 | } | 77 | } |
51 | 78 | ||
52 | 79 | ||
@@ -60,6 +87,12 @@ GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched, | |||
60 | void | 87 | void |
61 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h) | 88 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h) |
62 | { | 89 | { |
90 | // FIXME: serialize state!? (or is it always serialized???) | ||
91 | // FIXME: terminate receive-loop with client | ||
92 | GNUNET_CLIENT_disconnect (h->client); | ||
93 | GNUNET_free (h->client_name); | ||
94 | GNUNET_free (h); | ||
63 | } | 95 | } |
64 | 96 | ||
97 | |||
65 | /* end of fs.c */ | 98 | /* end of fs.c */ |