GNUnet  0.10.x
Functions
fs_unindex.c File Reference

Unindex file. More...

#include "platform.h"
#include "gnunet_constants.h"
#include "gnunet_fs_service.h"
#include "gnunet_protocols.h"
#include "fs_api.h"
#include "fs_tree.h"
#include "block_fs.h"
#include "fs_publish_ublock.h"
Include dependency graph for fs_unindex.c:

Go to the source code of this file.

Functions

static size_t unindex_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
 Function called by the tree encoder to obtain a block of plaintext data (for the lowest level of the tree). More...
 
void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset)
 Fill in all of the generic fields for an unindex event and call the callback. More...
 
static void unindex_progress (void *cls, uint64_t offset, const void *pt_block, size_t pt_size, unsigned int depth)
 Function called with information about our progress in computing the tree encoding. More...
 
static void signal_unindex_error (struct GNUNET_FS_UnindexContext *uc)
 We've encountered an error during unindexing. More...
 
static void process_cont (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
 Continuation called to notify client about result of the datastore removal operation. More...
 
static void unindex_process (void *cls, const struct ContentHashKey *chk, uint64_t offset, unsigned int depth, enum GNUNET_BLOCK_Type type, const void *block, uint16_t block_size)
 Function called asking for the current (encoded) block to be processed. More...
 
static void handle_unindex_response (void *cls, const struct GNUNET_MessageHeader *msg)
 Function called with the response from the FS service to our unindexing request. More...
 
static void unindex_mq_error_handler (void *cls, enum GNUNET_MQ_Error error)
 Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue. More...
 
static void unindex_finish (struct GNUNET_FS_UnindexContext *uc)
 Function called when we are done with removing UBlocks. More...
 
static void unindex_directory_scan_cb (void *cls, const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason)
 Function called by the directory scanner as we extract keywords that we will need to remove UBlocks. More...
 
void GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc)
 If necessary, connect to the datastore and remove the UBlocks. More...
 
static void continue_after_remove (void *cls, int32_t success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
 Continuation called to notify client about result of the remove operation for the UBlock. More...
 
static void process_kblock_for_unindex (void *cls, const struct GNUNET_HashCode *key, size_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, uint64_t uid)
 Function called from datastore with result from us looking for a UBlock. More...
 
void GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
 If necessary, connect to the datastore and remove the KBlocks. More...
 
static void unindex_extract_keywords (void *cls)
 Function called when the tree encoder has processed all blocks. More...
 
void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc)
 Connect to the datastore and remove the blocks. More...
 
void GNUNET_FS_unindex_process_hash_ (void *cls, const struct GNUNET_HashCode *file_id)
 Function called once the hash of the file that is being unindexed has been computed. More...
 
void GNUNET_FS_unindex_signal_suspend_ (void *cls)
 Create SUSPEND event for the given unindex operation and then clean up our state (without stop signal). More...
 
struct GNUNET_FS_UnindexContextGNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, void *cctx)
 Unindex a file. More...
 
void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc)
 Clean up after completion of an unindex operation. More...
 

Detailed Description

Unindex file.

Author
Krista Grothoff
Christian Grothoff

Definition in file fs_unindex.c.

Function Documentation

◆ unindex_reader()

static size_t unindex_reader ( void *  cls,
uint64_t  offset,
size_t  max,
void *  buf,
char **  emsg 
)
static

Function called by the tree encoder to obtain a block of plaintext data (for the lowest level of the tree).

Parameters
clsour publishing context
offsetidentifies which block to get
max(maximum) number of bytes to get; returning fewer will also cause errors
bufwhere to copy the plaintext buffer
emsglocation to store an error message (on error)
Returns
number of bytes copied to buf, 0 on error

Definition at line 51 of file fs_unindex.c.

References _, GNUNET_FS_UnindexContext::fh, GNUNET_FS_UnindexContext::file_size, GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_SEEK_SET, GNUNET_MIN, GNUNET_strdup, and uc.

Referenced by GNUNET_FS_unindex_do_remove_().

56 {
57  struct GNUNET_FS_UnindexContext *uc = cls;
58  size_t pt_size;
59 
60  pt_size = GNUNET_MIN (max, uc->file_size - offset);
61  if (offset != GNUNET_DISK_file_seek (uc->fh, offset, GNUNET_DISK_SEEK_SET))
62  {
63  *emsg = GNUNET_strdup (_("Failed to find given position in file"));
64  return 0;
65  }
66  if (pt_size != GNUNET_DISK_file_read (uc->fh, buf, pt_size))
67  {
68  *emsg = GNUNET_strdup (_("Failed to read file"));
69  return 0;
70  }
71  return pt_size;
72 }
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition: disk.c:881
static struct GNUNET_FS_UnindexContext * uc
off_t GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, enum GNUNET_DISK_Seek whence)
Move the read/write pointer in a file.
Definition: disk.c:241
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
struct GNUNET_DISK_FileHandle * fh
Handle used to read the file.
Definition: fs_api.h:1438
#define GNUNET_MIN(a, b)
Definition: gnunet_common.h:83
static char buf[2048]
Seek an absolute position (from the start of the file).
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_FS_unindex_make_status_()

void GNUNET_FS_unindex_make_status_ ( struct GNUNET_FS_ProgressInfo pi,
struct GNUNET_FS_UnindexContext uc,
uint64_t  offset 
)

Fill in all of the generic fields for an unindex event and call the callback.

Parameters
pistructure to fill in
ucoverall unindex context
offsetwhere we are in the file (for progress)

Definition at line 84 of file fs_unindex.c.

References GNUNET_FS_UnindexContext::client_info, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_FS_ProgressInfo::fsh, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_calculate_eta(), GNUNET_FS_UnindexContext::h, GNUNET_FS_UnindexContext::start_time, uc, GNUNET_FS_ProgressInfo::unindex, GNUNET_FS_Handle::upcb, GNUNET_FS_Handle::upcb_cls, and GNUNET_FS_ProgressInfo::value.

Referenced by deserialize_unindex_file(), GNUNET_FS_unindex_signal_suspend_(), GNUNET_FS_unindex_start(), GNUNET_FS_unindex_stop(), handle_unindex_response(), signal_unindex_error(), and unindex_progress().

87 {
88  pi->value.unindex.uc = uc;
89  pi->value.unindex.cctx = uc->client_info;
90  pi->value.unindex.filename = uc->filename;
91  pi->value.unindex.size = uc->file_size;
92  pi->value.unindex.eta =
94  pi->value.unindex.duration =
96  pi->value.unindex.completed = offset;
97  pi->fsh = uc->h;
98  uc->client_info = uc->h->upcb (uc->h->upcb_cls, pi);
99 }
static struct GNUNET_FS_UnindexContext * uc
union GNUNET_FS_ProgressInfo::@28 value
Values that depend on the event type.
struct GNUNET_TIME_Absolute start_time
When did we start?
Definition: fs_api.h:1474
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1406
struct GNUNET_FS_Handle * fsh
File-sharing handle that generated the event.
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
Definition: fs_api.h:1102
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Definition: time.c:373
void * upcb_cls
Closure for upcb.
Definition: fs_api.h:1107
struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start, uint64_t finished, uint64_t total)
Calculate the estimate time of arrival/completion for an operation.
Definition: time.c:549
void * client_info
Pointer kept for the client.
Definition: fs_api.h:1428
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
struct GNUNET_FS_ProgressInfo::@28::@32 unindex
Values for all "GNUNET_FS_STATUS_UNINDEX_*" events.
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unindex_progress()

static void unindex_progress ( void *  cls,
uint64_t  offset,
const void *  pt_block,
size_t  pt_size,
unsigned int  depth 
)
static

Function called with information about our progress in computing the tree encoding.

Parameters
clsclosure
offsetwhere are we in the file
pt_blockplaintext of the currently processed block
pt_sizesize of pt_block
depthdepth of the block in the tree, 0 for DBLOCK

Definition at line 113 of file fs_unindex.c.

References GNUNET_FS_ProgressInfo::depth, GNUNET_FS_STATUS_UNINDEX_PROGRESS, GNUNET_FS_unindex_make_status_(), GNUNET_FS_ProgressInfo::offset, GNUNET_FS_ProgressInfo::status, uc, GNUNET_FS_ProgressInfo::unindex, and GNUNET_FS_ProgressInfo::value.

Referenced by GNUNET_FS_unindex_do_remove_(), and unindex_finish().

118 {
119  struct GNUNET_FS_UnindexContext *uc = cls;
120  struct GNUNET_FS_ProgressInfo pi;
121 
123  pi.value.unindex.specifics.progress.data = pt_block;
124  pi.value.unindex.specifics.progress.offset = offset;
125  pi.value.unindex.specifics.progress.data_len = pt_size;
126  pi.value.unindex.specifics.progress.depth = depth;
128 }
unsigned int depth
Depth of the given block in the tree; 0 would be the lowest level (DBLOCKs).
Notification that we made progress unindexing a file.
static struct GNUNET_FS_UnindexContext * uc
uint64_t offset
At what offset in the file is "data"?
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
void GNUNET_FS_unindex_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset)
Fill in all of the generic fields for an unindex event and call the callback.
Definition: fs_unindex.c:84
Argument given to the progress callback with information about what is going on.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ signal_unindex_error()

static void signal_unindex_error ( struct GNUNET_FS_UnindexContext uc)
static

We've encountered an error during unindexing.

Signal the client.

Parameters
uccontext for the failed unindexing operation

Definition at line 138 of file fs_unindex.c.

References GNUNET_FS_UnindexContext::emsg, GNUNET_FS_STATUS_UNINDEX_ERROR, GNUNET_FS_unindex_make_status_(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_FS_ProgressInfo::status, GNUNET_FS_ProgressInfo::unindex, and GNUNET_FS_ProgressInfo::value.

Referenced by GNUNET_FS_unindex_do_remove_(), GNUNET_FS_unindex_do_remove_kblocks_(), GNUNET_FS_unindex_process_hash_(), process_cont(), unindex_finish(), and unindex_mq_error_handler().

139 {
140  struct GNUNET_FS_ProgressInfo pi;
141 
143  pi.value.unindex.eta = GNUNET_TIME_UNIT_FOREVER_REL;
144  pi.value.unindex.specifics.error.message = uc->emsg;
146 }
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
void GNUNET_FS_unindex_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset)
Fill in all of the generic fields for an unindex event and call the callback.
Definition: fs_unindex.c:84
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
Notification that we encountered an error unindexing a file.
Argument given to the progress callback with information about what is going on.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_cont()

static void process_cont ( void *  cls,
int  success,
struct GNUNET_TIME_Absolute  min_expiration,
const char *  msg 
)
static

Continuation called to notify client about result of the datastore removal operation.

Parameters
clsclosure
successGNUNET_SYSERR on failure
min_expirationminimum expiration time required for content to be stored
msgNULL on success, otherwise an error message

Definition at line 159 of file fs_unindex.c.

References GNUNET_FS_UnindexContext::emsg, GNUNET_ERROR_TYPE_DEBUG, GNUNET_FS_tree_encoder_next(), GNUNET_log, GNUNET_strdup, GNUNET_SYSERR, signal_unindex_error(), GNUNET_FS_UnindexContext::tc, and uc.

Referenced by unindex_process().

163 {
164  struct GNUNET_FS_UnindexContext *uc = cls;
165 
166  if (success == GNUNET_SYSERR)
167  {
168  uc->emsg = GNUNET_strdup (msg);
170  return;
171  }
173  "Datastore REMOVE operation succeeded\n");
175 }
static void signal_unindex_error(struct GNUNET_FS_UnindexContext *uc)
We've encountered an error during unindexing.
Definition: fs_unindex.c:138
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1433
static struct GNUNET_FS_UnindexContext * uc
void GNUNET_FS_tree_encoder_next(struct GNUNET_FS_TreeEncoder *te)
Encrypt the next block of the file (and call proc and progress accordingly; or of course "cont" if we...
Definition: fs_tree.c:332
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
#define GNUNET_log(kind,...)
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unindex_process()

static void unindex_process ( void *  cls,
const struct ContentHashKey chk,
uint64_t  offset,
unsigned int  depth,
enum GNUNET_BLOCK_Type  type,
const void *  block,
uint16_t  block_size 
)
static

Function called asking for the current (encoded) block to be processed.

After processing the client should either call "GNUNET_FS_tree_encode_next" or (on error) "GNUNET_FS_tree_encode_finish".

Parameters
clsclosure
chkcontent hash key for the block (key for lookup in the datastore)
offsetoffset of the block
depthdepth of the block, 0 for DBLOCK
typetype of the block (IBLOCK or DBLOCK)
blockthe (encrypted) block
block_sizesize of block (in bytes)

Definition at line 193 of file fs_unindex.c.

References GNUNET_FS_UnindexContext::chk, data, GNUNET_FS_UnindexContext::dsh, OnDemandBlock::file_id, GNUNET_FS_UnindexContext::file_id, GNUNET_BLOCK_TYPE_FS_DBLOCK, GNUNET_DATASTORE_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_htonll(), GNUNET_log, OnDemandBlock::offset, process_cont(), ContentHashKey::query, size, and uc.

Referenced by GNUNET_FS_unindex_do_remove_().

200 {
201  struct GNUNET_FS_UnindexContext *uc = cls;
202  uint32_t size;
203  const void *data;
204  struct OnDemandBlock odb;
205 
207  {
208  size = block_size;
209  data = block;
210  }
211  else /* on-demand encoded DBLOCK */
212  {
213  size = sizeof (struct OnDemandBlock);
214  odb.offset = GNUNET_htonll (offset);
215  odb.file_id = uc->file_id;
216  data = &odb;
217  }
219  "Sending REMOVE request to DATASTORE service\n");
220  GNUNET_DATASTORE_remove (uc->dsh, &chk->query, size, data, -2, 1,
221  &process_cont, uc);
222  uc->chk = *chk;
223 }
static struct GNUNET_FS_UnindexContext * uc
struct GNUNET_HashCode file_id
Hash of the file's contents (once computed).
Definition: fs_api.h:1479
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
struct GNUNET_HashCode query
Hash of the encrypted content, used for querying.
Definition: fs.h:63
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_remove(struct GNUNET_DATASTORE_Handle *h, const struct GNUNET_HashCode *key, size_t size, const void *data, unsigned int queue_priority, unsigned int max_queue_size, GNUNET_DATASTORE_ContinuationWithStatus cont, void *cont_cls)
Explicitly remove some content from the database.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Definition: common_endian.c:35
static unsigned int size
Size of the "table".
Definition: peer.c:67
static void process_cont(void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
Continuation called to notify client about result of the datastore removal operation.
Definition: fs_unindex.c:159
struct ContentHashKey chk
The content hash key of the last block we processed, will in the end be set to the CHK from the URI...
Definition: fs_api.h:1376
#define GNUNET_log(kind,...)
uint64_t offset
At which offset should we be able to find this on-demand encoded block? (in NBO)
Definition: block_fs.h:97
Data block (leaf) in the CHK tree.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
uint32_t data
The data value.
index block (indexing a DBlock that can be obtained directly from reading the plaintext file) ...
Definition: block_fs.h:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_unindex_response()

static void handle_unindex_response ( void *  cls,
const struct GNUNET_MessageHeader msg 
)
static

Function called with the response from the FS service to our unindexing request.

Parameters
clsclosure, unindex context
msgthe response

Definition at line 234 of file fs_unindex.c.

References GNUNET_FS_UnindexContext::file_size, GNUNET_FS_STATUS_UNINDEX_COMPLETED, GNUNET_FS_unindex_make_status_(), GNUNET_FS_unindex_sync_(), GNUNET_MQ_destroy(), GNUNET_TIME_UNIT_ZERO, GNUNET_FS_UnindexContext::mq, GNUNET_FS_UnindexContext::state, GNUNET_FS_ProgressInfo::status, uc, GNUNET_FS_ProgressInfo::unindex, UNINDEX_STATE_COMPLETE, and GNUNET_FS_ProgressInfo::value.

236 {
237  struct GNUNET_FS_UnindexContext *uc = cls;
238  struct GNUNET_FS_ProgressInfo pi;
239 
240  if (NULL != uc->mq)
241  {
242  GNUNET_MQ_destroy (uc->mq);
243  uc->mq = NULL;
244  }
247  pi.value.unindex.eta = GNUNET_TIME_UNIT_ZERO;
250  uc,
251  uc->file_size);
252 }
We're done.
Definition: fs_api.h:1357
static struct GNUNET_FS_UnindexContext * uc
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1417
Notification that the unindexing of this file was completed.
void GNUNET_FS_unindex_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset)
Fill in all of the generic fields for an unindex event and call the callback.
Definition: fs_unindex.c:84
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:824
Argument given to the progress callback with information about what is going on.
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
Here is the call graph for this function:

◆ unindex_mq_error_handler()

static void unindex_mq_error_handler ( void *  cls,
enum GNUNET_MQ_Error  error 
)
static

Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue.

Not every message queue implementation supports an error handler.

Parameters
clsclosure with the struct GNUNET_FS_UnindexContext *
errorerror code

Definition at line 264 of file fs_unindex.c.

References _, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_unindex_sync_(), GNUNET_MQ_destroy(), GNUNET_strdup, GNUNET_FS_UnindexContext::mq, signal_unindex_error(), GNUNET_FS_UnindexContext::state, uc, and UNINDEX_STATE_ERROR.

Referenced by unindex_finish().

266 {
267  struct GNUNET_FS_UnindexContext *uc = cls;
268 
269  if (NULL != uc->mq)
270  {
271  GNUNET_MQ_destroy (uc->mq);
272  uc->mq = NULL;
273  }
275  uc->emsg = GNUNET_strdup (_("Error communicating with `fs' service."));
278 }
static void signal_unindex_error(struct GNUNET_FS_UnindexContext *uc)
We've encountered an error during unindexing.
Definition: fs_unindex.c:138
static struct GNUNET_FS_UnindexContext * uc
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
We've encountered a fatal error.
Definition: fs_api.h:1362
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1417
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:824
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unindex_finish()

static void unindex_finish ( struct GNUNET_FS_UnindexContext uc)
static

Function called when we are done with removing UBlocks.

Disconnect from datastore and notify FS service about the unindex event.

Parameters
ucour unindexing context

Definition at line 289 of file fs_unindex.c.

References _, GNUNET_FS_Handle::cfg, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, env, GNUNET_FS_UnindexContext::fh, UnindexMessage::file_id, GNUNET_FS_UnindexContext::file_id, GNUNET_FS_UnindexContext::file_size, GNUNET_CLIENT_connect(), GNUNET_DATASTORE_disconnect(), GNUNET_DISK_file_close(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_FS_tree_encoder_finish(), GNUNET_FS_unindex_sync_(), GNUNET_log, GNUNET_MESSAGE_TYPE_FS_UNINDEX, GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_strdup, GNUNET_FS_UnindexContext::h, GNUNET_FS_UnindexContext::mq, UnindexMessage::reserved, signal_unindex_error(), GNUNET_FS_UnindexContext::state, GNUNET_FS_UnindexContext::tc, unindex_mq_error_handler(), unindex_progress(), UNINDEX_STATE_ERROR, and UNINDEX_STATE_FS_NOTIFY.

Referenced by GNUNET_FS_unindex_do_remove_kblocks_(), and unindex_directory_scan_cb().

290 {
292  GNUNET_MQ_hd_fixed_size (unindex_response,
294  struct GNUNET_MessageHeader,
295  uc),
297  };
298  char *emsg;
299  struct GNUNET_MQ_Envelope *env;
300  struct UnindexMessage *req;
301 
302  /* generate final progress message */
303  unindex_progress (uc,
304  uc->file_size,
305  NULL,
306  0,
307  0);
309  &emsg);
310  uc->tc = NULL;
312  uc->fh = NULL;
314  uc->dsh = NULL;
317  uc->mq = GNUNET_CLIENT_connect (uc->h->cfg,
318  "fs",
319  handlers,
321  uc);
322  if (NULL == uc->mq)
323  {
325  uc->emsg =
326  GNUNET_strdup (_("Failed to connect to FS service for unindexing."));
329  return;
330  }
332  "Sending UNINDEX message to FS service\n");
333  env = GNUNET_MQ_msg (req,
335  req->reserved = 0;
336  req->file_id = uc->file_id;
337  GNUNET_MQ_send (uc->mq,
338  env);
339 }
static void signal_unindex_error(struct GNUNET_FS_UnindexContext *uc)
We've encountered an error during unindexing.
Definition: fs_unindex.c:138
int GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h)
Close an open file.
Definition: disk.c:1817
uint32_t reserved
Always zero.
Definition: fs.h:242
static void unindex_progress(void *cls, uint64_t offset, const void *pt_block, size_t pt_size, unsigned int depth)
Function called with information about our progress in computing the tree encoding.
Definition: fs_unindex.c:113
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
Definition: client.c:901
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1433
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_NO
Definition: gnunet_common.h:81
struct GNUNET_HashCode file_id
Hash of the file's contents (once computed).
Definition: fs_api.h:1479
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
static void unindex_mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
Definition: fs_unindex.c:264
We're notifying the FS service about the unindexing.
Definition: fs_api.h:1352
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
struct GNUNET_DISK_FileHandle * fh
Handle used to read the file.
Definition: fs_api.h:1438
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
Message sent from a GNUnet (fs) unindexing activity to the gnunet-service-fs to indicate that a file ...
Definition: fs.h:231
struct GNUNET_HashCode file_id
Hash of the file that we will unindex.
Definition: fs.h:247
We've encountered a fatal error.
Definition: fs_api.h:1362
Message handler for a specific message type.
#define GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK
Reply to client indicating unindex receipt.
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1417
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_FS_UNINDEX
Request from client to unindex a file.
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
void GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, int drop)
Disconnect from the datastore service (and free associated resources).
#define GNUNET_log(kind,...)
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
Header for all communications.
void GNUNET_FS_tree_encoder_finish(struct GNUNET_FS_TreeEncoder *te, char **emsg)
Clean up a tree encoder and return information about possible errors.
Definition: fs_tree.c:444
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1092
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unindex_directory_scan_cb()

static void unindex_directory_scan_cb ( void *  cls,
const char *  filename,
int  is_directory,
enum GNUNET_FS_DirScannerProgressUpdateReason  reason 
)
static

Function called by the directory scanner as we extract keywords that we will need to remove UBlocks.

Parameters
clsthe 'struct GNUNET_FS_UnindexContext *'
filenamewhich file we are making progress on
is_directoryGNUNET_YES if this is a directory, GNUNET_NO if this is a file GNUNET_SYSERR if it is neither (or unknown)
reasonkind of progress we are making

Definition at line 354 of file fs_unindex.c.

References _, GNUNET_FS_UnindexContext::dscan, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::filename, GNUNET_ERROR_TYPE_WARNING, GNUNET_FS_directory_scan_abort(), GNUNET_FS_directory_scan_get_result(), GNUNET_FS_DIRSCANNER_FINISHED, GNUNET_FS_DIRSCANNER_INTERNAL_ERROR, GNUNET_FS_share_tree_free(), GNUNET_FS_unindex_do_remove_kblocks_(), GNUNET_FS_unindex_sync_(), GNUNET_FS_uri_dup(), GNUNET_log, GNUNET_strdup, GNUNET_FS_UnindexContext::ksk_uri, GNUNET_FS_ShareTreeItem::ksk_uri, GNUNET_FS_UnindexContext::state, uc, unindex_finish(), and UNINDEX_STATE_DS_REMOVE_KBLOCKS.

Referenced by GNUNET_FS_unindex_do_extract_keywords_().

358 {
359  struct GNUNET_FS_UnindexContext *uc = cls;
360  static struct GNUNET_FS_ShareTreeItem * directory_scan_result;
361 
362  switch (reason)
363  {
365  directory_scan_result = GNUNET_FS_directory_scan_get_result (uc->dscan);
366  uc->dscan = NULL;
367  if (NULL != directory_scan_result->ksk_uri)
368  {
369  uc->ksk_uri = GNUNET_FS_uri_dup (directory_scan_result->ksk_uri);
373  }
374  else
375  {
376  uc->emsg = GNUNET_strdup (_("Failed to get KSKs from directory scan."));
378  unindex_finish (uc);
379  }
380  GNUNET_FS_share_tree_free (directory_scan_result);
381  break;
384  _("Internal error scanning `%s'.\n"),
385  uc->filename);
387  uc->dscan = NULL;
388  uc->emsg = GNUNET_strdup (_("Failed to get KSKs from directory scan."));
390  unindex_finish (uc);
391  break;
392  default:
393  break;
394  }
395 }
static struct GNUNET_FS_UnindexContext * uc
struct GNUNET_FS_Uri * ksk_uri
Keywords for this file or directory (derived from metadata).
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_FS_Uri * GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri)
Duplicate URI.
Definition: fs_uri.c:988
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
A node of a directory tree (produced by dirscanner)
void GNUNET_FS_unindex_do_remove_kblocks_(struct GNUNET_FS_UnindexContext *uc)
If necessary, connect to the datastore and remove the KBlocks.
Definition: fs_unindex.c:576
We're telling the datastore to remove KBlocks.
Definition: fs_api.h:1346
void GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds)
Abort the scan.
There was an internal error.
struct GNUNET_FS_Uri * ksk_uri
Keywords found (telling us which KBlocks to remove).
Definition: fs_api.h:1396
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1406
Last call to the progress function: we have finished scanning the directory.
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
static void unindex_finish(struct GNUNET_FS_UnindexContext *uc)
Function called when we are done with removing UBlocks.
Definition: fs_unindex.c:289
void GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel)
Release memory of a share item tree.
Definition: fs_sharetree.c:432
struct GNUNET_FS_DirScanner * dscan
Directory scanner to find keywords (KBlock removal).
Definition: fs_api.h:1391
#define GNUNET_log(kind,...)
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
struct GNUNET_FS_ShareTreeItem * GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds)
Obtain the result of the scan after the scan has signalled completion.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_FS_unindex_do_extract_keywords_()

void GNUNET_FS_unindex_do_extract_keywords_ ( struct GNUNET_FS_UnindexContext uc)

If necessary, connect to the datastore and remove the UBlocks.

Extract the keywords for KBlock removal.

Parameters
uccontext for the unindex operation.

Definition at line 404 of file fs_unindex.c.

References GNUNET_FS_Handle::cfg, GNUNET_FS_UnindexContext::dscan, GNUNET_FS_UnindexContext::filename, GNUNET_CONFIGURATION_get_value_string(), GNUNET_free_non_null, GNUNET_FS_directory_scan_start(), GNUNET_NO, GNUNET_OK, GNUNET_FS_UnindexContext::h, and unindex_directory_scan_cb().

Referenced by deserialize_unindex_file(), and unindex_extract_keywords().

405 {
406  char *ex;
407 
408  if (GNUNET_OK !=
409  GNUNET_CONFIGURATION_get_value_string (uc->h->cfg, "FS", "EXTRACTORS", &ex))
410  ex = NULL;
412  GNUNET_NO, ex,
414  uc);
416 }
struct GNUNET_FS_DirScanner * GNUNET_FS_directory_scan_start(const char *filename, int disable_extractor, const char *ex, GNUNET_FS_DirScannerProgressCallback cb, void *cb_cls)
Start a directory scanner thread.
#define GNUNET_NO
Definition: gnunet_common.h:81
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1406
int GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
static void unindex_directory_scan_cb(void *cls, const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason)
Function called by the directory scanner as we extract keywords that we will need to remove UBlocks...
Definition: fs_unindex.c:354
struct GNUNET_FS_DirScanner * dscan
Directory scanner to find keywords (KBlock removal).
Definition: fs_api.h:1391
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1092
Here is the call graph for this function:
Here is the caller graph for this function:

◆ continue_after_remove()

static void continue_after_remove ( void *  cls,
int32_t  success,
struct GNUNET_TIME_Absolute  min_expiration,
const char *  msg 
)
static

Continuation called to notify client about result of the remove operation for the UBlock.

Parameters
clsthe 'struct GNUNET_FS_UnindexContext *'
successGNUNET_SYSERR on failure (including timeout/queue drop) GNUNET_NO if content was already there GNUNET_YES (or other positive value) on success
min_expirationminimum expiration time required for 0-priority content to be stored by the datacache at this time, zero for unknown, forever if we have no space for 0-priority content
msgNULL on success, otherwise an error message

Definition at line 433 of file fs_unindex.c.

References _, GNUNET_FS_UnindexContext::dqe, GNUNET_ERROR_TYPE_WARNING, GNUNET_FS_unindex_do_remove_kblocks_(), GNUNET_log, GNUNET_YES, GNUNET_FS_UnindexContext::ksk_offset, and uc.

Referenced by process_kblock_for_unindex().

437 {
438  struct GNUNET_FS_UnindexContext *uc = cls;
439 
440  uc->dqe = NULL;
441  if (success != GNUNET_YES)
443  _("Failed to remove UBlock: %s\n"),
444  msg);
445  uc->ksk_offset++;
447 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
uint32_t ksk_offset
Current offset in KSK removal.
Definition: fs_api.h:1401
static struct GNUNET_FS_UnindexContext * uc
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
void GNUNET_FS_unindex_do_remove_kblocks_(struct GNUNET_FS_UnindexContext *uc)
If necessary, connect to the datastore and remove the KBlocks.
Definition: fs_unindex.c:576
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore 'get_key' operation issued for obtaining KBlocks.
Definition: fs_api.h:1444
#define GNUNET_log(kind,...)
#define GNUNET_YES
Definition: gnunet_common.h:80
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_kblock_for_unindex()

static void process_kblock_for_unindex ( void *  cls,
const struct GNUNET_HashCode key,
size_t  size,
const void *  data,
enum GNUNET_BLOCK_Type  type,
uint32_t  priority,
uint32_t  anonymity,
uint32_t  replication,
struct GNUNET_TIME_Absolute  expiration,
uint64_t  uid 
)
static

Function called from datastore with result from us looking for a UBlock.

There are four cases: 1) no result, means we move on to the next keyword 2) data hash is the same as an already seen data hash, means we move on to next keyword 3) UBlock for a different CHK, means we keep looking for more 4) UBlock is for our CHK, means we remove the block and then move on to the next keyword

Parameters
clsthe 'struct GNUNET_FS_UnindexContext *'
keykey for the content
sizenumber of bytes in data
datacontent stored
typetype of the content
prioritypriority of the content
anonymityanonymity-level for the content
replicationreplication-level for the content
expirationexpiration time for the content
uidunique identifier for the datum; maybe 0 if no unique identifier is available

Definition at line 473 of file fs_unindex.c.

References GNUNET_FS_Uri::chk, FileIdentifier::chk, GNUNET_FS_UnindexContext::chk, continue_after_remove(), data, GNUNET_FS_Uri::data, GNUNET_FS_UnindexContext::dqe, GNUNET_FS_UnindexContext::dsh, GNUNET_assert, GNUNET_BLOCK_TYPE_FS_UBLOCK, GNUNET_break, GNUNET_break_op, GNUNET_CRYPTO_ecdsa_key_get_anonymous(), GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_CRYPTO_hash(), GNUNET_DATASTORE_get_key(), GNUNET_DATASTORE_remove(), GNUNET_FS_ublock_decrypt_(), GNUNET_FS_unindex_do_remove_kblocks_(), GNUNET_FS_uri_destroy(), GNUNET_FS_uri_parse(), GNUNET_FS_Uri::ksk, GNUNET_FS_UnindexContext::ksk_offset, GNUNET_FS_UnindexContext::ksk_uri, uc, GNUNET_FS_UnindexContext::uquery, and UBlock::verification_key.

Referenced by GNUNET_FS_unindex_do_remove_kblocks_().

483 {
484  struct GNUNET_FS_UnindexContext *uc = cls;
485  const struct UBlock *ub;
486  struct GNUNET_FS_Uri *chk_uri;
487  struct GNUNET_HashCode query;
488 
489  uc->dqe = NULL;
490  if (NULL == data)
491  {
492  /* no result */
493  uc->ksk_offset++;
495  return;
496  }
498  if (size < sizeof (struct UBlock))
499  {
500  GNUNET_break (0);
501  goto get_next;
502  }
503  ub = data;
505  sizeof (ub->verification_key),
506  &query);
507  if (0 != memcmp (&query,
508  key,
509  sizeof (struct GNUNET_HashCode)))
510  {
511  /* result does not match our keyword, skip */
512  goto get_next;
513  }
514  {
515  char pt[size - sizeof (struct UBlock)];
516  struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub;
517  const char *keyword;
518 
520  &anon_pub);
521  keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
522  GNUNET_FS_ublock_decrypt_ (&ub[1], size - sizeof (struct UBlock),
523  &anon_pub,
524  keyword,
525  pt);
526  if (NULL == memchr (&pt[1], 0, sizeof (pt) - 1))
527  {
528  GNUNET_break_op (0); /* malformed UBlock */
529  goto get_next;
530  }
531  chk_uri = GNUNET_FS_uri_parse (&pt[1], NULL);
532  if (NULL == chk_uri)
533  {
534  GNUNET_break_op (0); /* malformed UBlock */
535  goto get_next;
536  }
537  }
538  if (0 != memcmp (&uc->chk,
539  &chk_uri->data.chk.chk,
540  sizeof (struct ContentHashKey)))
541  {
542  /* different CHK, ignore */
543  GNUNET_FS_uri_destroy (chk_uri);
544  goto get_next;
545  }
546  GNUNET_FS_uri_destroy (chk_uri);
547  /* matches! */
548  uc->dqe = GNUNET_DATASTORE_remove (uc->dsh,
549  key,
550  size,
551  data,
552  0 /* priority */,
553  1 /* queue size */,
555  uc);
556  return;
557  get_next:
558  uc->dqe = GNUNET_DATASTORE_get_key (uc->dsh,
559  uid + 1 /* next_uid */,
560  false /* random */,
561  &uc->uquery,
563  0 /* priority */,
564  1 /* queue size */,
566  uc);
567 }
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_CRYPTO_ecdsa_key_get_anonymous(void)
Get the shared private key we use for anonymous users.
Definition: crypto_ecc.c:814
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
Definition: fs_api.h:104
struct FileIdentifier chk
Information needed to retrieve a file (content-hash-key plus file size).
Definition: fs_api.h:215
content hash key
Definition: fs.h:53
uint32_t ksk_offset
Current offset in KSK removal.
Definition: fs_api.h:1401
struct GNUNET_FS_Uri * GNUNET_FS_uri_parse(const char *uri, char **emsg)
Convert a UTF-8 String to a URI.
Definition: fs_uri.c:635
static void continue_after_remove(void *cls, int32_t success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
Continuation called to notify client about result of the remove operation for the UBlock...
Definition: fs_unindex.c:433
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_FS_ublock_decrypt_(const void *input, size_t input_len, const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, const char *label, void *output)
Decrypt the given UBlock, storing the result in output.
static struct GNUNET_FS_UnindexContext * uc
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
struct GNUNET_HashCode uquery
Current query of &#39;get_key&#39; operation.
Definition: fs_api.h:1454
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:44
struct GNUNET_FS_Uri::@16::@17 ksk
void GNUNET_FS_unindex_do_remove_kblocks_(struct GNUNET_FS_UnindexContext *uc)
If necessary, connect to the datastore and remove the KBlocks.
Definition: fs_unindex.c:576
union GNUNET_FS_Uri::@16 data
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_remove(struct GNUNET_DATASTORE_Handle *h, const struct GNUNET_HashCode *key, size_t size, const void *data, unsigned int queue_priority, unsigned int max_queue_size, GNUNET_DATASTORE_ContinuationWithStatus cont, void *cont_cls)
Explicitly remove some content from the database.
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
Definition: fs_uri.c:670
struct GNUNET_FS_Uri * ksk_uri
Keywords found (telling us which KBlocks to remove).
Definition: fs_api.h:1396
Type of a block representing any type of search result (universal).
A 512-bit hashcode.
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore &#39;get_key&#39; operation issued for obtaining KBlocks.
Definition: fs_api.h:1444
static unsigned int size
Size of the "table".
Definition: peer.c:67
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:241
static void process_kblock_for_unindex(void *cls, const struct GNUNET_HashCode *key, size_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, uint64_t uid)
Function called from datastore with result from us looking for a UBlock.
Definition: fs_unindex.c:473
A Universal Resource Identifier (URI), opaque.
Definition: fs_api.h:168
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
struct ContentHashKey chk
The content hash key of the last block we processed, will in the end be set to the CHK from the URI...
Definition: fs_api.h:1376
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_get_key(struct GNUNET_DATASTORE_Handle *h, uint64_t next_uid, bool random, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, unsigned int queue_priority, unsigned int max_queue_size, GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls)
Get a result for a particular key from the datastore.
uint32_t data
The data value.
struct GNUNET_CRYPTO_EcdsaPublicKey verification_key
Public key used to sign this block.
Definition: block_fs.h:66
universal block for keyword and namespace search results
Definition: block_fs.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_FS_unindex_do_remove_kblocks_()

void GNUNET_FS_unindex_do_remove_kblocks_ ( struct GNUNET_FS_UnindexContext uc)

If necessary, connect to the datastore and remove the KBlocks.

Parameters
uccontext for the unindex operation.

Definition at line 576 of file fs_unindex.c.

References _, GNUNET_FS_Handle::cfg, GNUNET_FS_Uri::data, GNUNET_FS_UnindexContext::dqe, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, GNUNET_BLOCK_TYPE_FS_UBLOCK, GNUNET_CRYPTO_ecdsa_key_get_anonymous(), GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_CRYPTO_ecdsa_public_key_derive(), GNUNET_CRYPTO_hash(), GNUNET_DATASTORE_connect(), GNUNET_DATASTORE_get_key(), GNUNET_FS_unindex_sync_(), GNUNET_strdup, GNUNET_FS_UnindexContext::h, GNUNET_FS_Uri::ksk, GNUNET_FS_UnindexContext::ksk_offset, GNUNET_FS_UnindexContext::ksk_uri, process_kblock_for_unindex(), signal_unindex_error(), GNUNET_FS_UnindexContext::state, unindex_finish(), UNINDEX_STATE_ERROR, and GNUNET_FS_UnindexContext::uquery.

Referenced by continue_after_remove(), deserialize_unindex_file(), process_kblock_for_unindex(), and unindex_directory_scan_cb().

577 {
578  const char *keyword;
579  const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon;
580  struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub;
581  struct GNUNET_CRYPTO_EcdsaPublicKey dpub;
582 
583  if (NULL == uc->dsh)
584  uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg);
585  if (NULL == uc->dsh)
586  {
588  uc->emsg = GNUNET_strdup (_("Failed to connect to `datastore' service."));
591  return;
592  }
593  if ( (NULL == uc->ksk_uri) ||
594  (uc->ksk_offset >= uc->ksk_uri->data.ksk.keywordCount) )
595  {
596  unindex_finish (uc);
597  return;
598  }
601  &anon_pub);
602  keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
604  keyword,
605  "fs-ublock",
606  &dpub);
607  GNUNET_CRYPTO_hash (&dpub,
608  sizeof (dpub),
609  &uc->uquery);
610  uc->dqe = GNUNET_DATASTORE_get_key (uc->dsh,
611  0 /* next_uid */,
612  false /* random */,
613  &uc->uquery,
615  0 /* priority */,
616  1 /* queue size */,
618  uc);
619 }
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_CRYPTO_ecdsa_key_get_anonymous(void)
Get the shared private key we use for anonymous users.
Definition: crypto_ecc.c:814
static void signal_unindex_error(struct GNUNET_FS_UnindexContext *uc)
We&#39;ve encountered an error during unindexing.
Definition: fs_unindex.c:138
void GNUNET_CRYPTO_ecdsa_public_key_derive(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EcdsaPublicKey *result)
Derive a public key from a given public key and a label.
Definition: crypto_ecc.c:1339
uint32_t ksk_offset
Current offset in KSK removal.
Definition: fs_api.h:1401
Private ECC key encoded for transmission.
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
struct GNUNET_HashCode uquery
Current query of &#39;get_key&#39; operation.
Definition: fs_api.h:1454
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:44
struct GNUNET_FS_Uri::@16::@17 ksk
union GNUNET_FS_Uri::@16 data
We&#39;ve encountered a fatal error.
Definition: fs_api.h:1362
struct GNUNET_FS_Uri * ksk_uri
Keywords found (telling us which KBlocks to remove).
Definition: fs_api.h:1396
Type of a block representing any type of search result (universal).
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore &#39;get_key&#39; operation issued for obtaining KBlocks.
Definition: fs_api.h:1444
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:241
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
static void unindex_finish(struct GNUNET_FS_UnindexContext *uc)
Function called when we are done with removing UBlocks.
Definition: fs_unindex.c:289
static void process_kblock_for_unindex(void *cls, const struct GNUNET_HashCode *key, size_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, uint64_t uid)
Function called from datastore with result from us looking for a UBlock.
Definition: fs_unindex.c:473
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_get_key(struct GNUNET_DATASTORE_Handle *h, uint64_t next_uid, bool random, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, unsigned int queue_priority, unsigned int max_queue_size, GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls)
Get a result for a particular key from the datastore.
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
struct GNUNET_DATASTORE_Handle * GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the datastore service.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1092
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unindex_extract_keywords()

static void unindex_extract_keywords ( void *  cls)
static

Function called when the tree encoder has processed all blocks.

Clean up.

Parameters
clsour unindexing context

Definition at line 629 of file fs_unindex.c.

References GNUNET_FS_unindex_do_extract_keywords_(), GNUNET_FS_unindex_sync_(), GNUNET_FS_UnindexContext::state, uc, and UNINDEX_STATE_EXTRACT_KEYWORDS.

Referenced by GNUNET_FS_unindex_do_remove_().

630 {
631  struct GNUNET_FS_UnindexContext *uc = cls;
632 
636 }
static struct GNUNET_FS_UnindexContext * uc
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
Find out which keywords apply.
Definition: fs_api.h:1341
void GNUNET_FS_unindex_do_extract_keywords_(struct GNUNET_FS_UnindexContext *uc)
If necessary, connect to the datastore and remove the UBlocks.
Definition: fs_unindex.c:404
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_FS_unindex_do_remove_()

void GNUNET_FS_unindex_do_remove_ ( struct GNUNET_FS_UnindexContext uc)

Connect to the datastore and remove the blocks.

Parameters
uccontext for the unindex operation.

Definition at line 645 of file fs_unindex.c.

References _, GNUNET_FS_Handle::cfg, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::fh, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_DATASTORE_connect(), GNUNET_DATASTORE_disconnect(), GNUNET_DISK_file_open(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_FS_tree_encoder_create(), GNUNET_FS_tree_encoder_next(), GNUNET_FS_unindex_sync_(), GNUNET_NO, GNUNET_strdup, GNUNET_FS_UnindexContext::h, signal_unindex_error(), GNUNET_FS_UnindexContext::state, GNUNET_FS_UnindexContext::tc, unindex_extract_keywords(), unindex_process(), unindex_progress(), unindex_reader(), and UNINDEX_STATE_ERROR.

Referenced by deserialize_unindex_file(), and GNUNET_FS_unindex_process_hash_().

646 {
647  if (NULL == uc->dsh)
648  uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg);
649  if (NULL == uc->dsh)
650  {
652  uc->emsg = GNUNET_strdup (_("Failed to connect to `datastore' service."));
655  return;
656  }
657  uc->fh =
660  if (NULL == uc->fh)
661  {
663  uc->dsh = NULL;
665  uc->emsg = GNUNET_strdup (_("Failed to open file for unindexing."));
668  return;
669  }
670  uc->tc =
672  uc->file_size,
673  uc,
679 }
Open the file for reading.
static void signal_unindex_error(struct GNUNET_FS_UnindexContext *uc)
We&#39;ve encountered an error during unindexing.
Definition: fs_unindex.c:138
static void unindex_progress(void *cls, uint64_t offset, const void *pt_block, size_t pt_size, unsigned int depth)
Function called with information about our progress in computing the tree encoding.
Definition: fs_unindex.c:113
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1433
Nobody is allowed to do anything to the file.
void GNUNET_FS_tree_encoder_next(struct GNUNET_FS_TreeEncoder *te)
Encrypt the next block of the file (and call proc and progress accordingly; or of course "cont" if we...
Definition: fs_tree.c:332
#define GNUNET_NO
Definition: gnunet_common.h:81
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
static void unindex_process(void *cls, const struct ContentHashKey *chk, uint64_t offset, unsigned int depth, enum GNUNET_BLOCK_Type type, const void *block, uint16_t block_size)
Function called asking for the current (encoded) block to be processed.
Definition: fs_unindex.c:193
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
struct GNUNET_DISK_FileHandle * fh
Handle used to read the file.
Definition: fs_api.h:1438
We&#39;ve encountered a fatal error.
Definition: fs_api.h:1362
struct GNUNET_FS_TreeEncoder * GNUNET_FS_tree_encoder_create(struct GNUNET_FS_Handle *h, uint64_t size, void *cls, GNUNET_FS_DataReader reader, GNUNET_FS_TreeBlockProcessor proc, GNUNET_FS_TreeProgressCallback progress, GNUNET_SCHEDULER_TaskCallback cont)
Initialize a tree encoder.
Definition: fs_tree.c:270
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1406
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
void GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, int drop)
Disconnect from the datastore service (and free associated resources).
static void unindex_extract_keywords(void *cls)
Function called when the tree encoder has processed all blocks.
Definition: fs_unindex.c:629
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
static size_t unindex_reader(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function called by the tree encoder to obtain a block of plaintext data (for the lowest level of the ...
Definition: fs_unindex.c:51
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
Definition: disk.c:1673
struct GNUNET_DATASTORE_Handle * GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the datastore service.
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: fs_api.h:1092
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_FS_unindex_process_hash_()

void GNUNET_FS_unindex_process_hash_ ( void *  cls,
const struct GNUNET_HashCode file_id 
)

Function called once the hash of the file that is being unindexed has been computed.

Parameters
clsclosure, unindex context
file_idcomputed hash, NULL on error

Definition at line 690 of file fs_unindex.c.

References _, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::fhc, GNUNET_FS_UnindexContext::file_id, GNUNET_FS_unindex_do_remove_(), GNUNET_FS_unindex_stop(), GNUNET_FS_unindex_sync_(), GNUNET_strdup, signal_unindex_error(), GNUNET_FS_UnindexContext::state, uc, UNINDEX_STATE_DS_REMOVE, UNINDEX_STATE_ERROR, and UNINDEX_STATE_HASHING.

Referenced by deserialize_unindex_file(), and GNUNET_FS_unindex_start().

692 {
693  struct GNUNET_FS_UnindexContext *uc = cls;
694 
695  uc->fhc = NULL;
696  if (uc->state != UNINDEX_STATE_HASHING)
697  {
699  return;
700  }
701  if (file_id == NULL)
702  {
704  uc->emsg = GNUNET_strdup (_("Failed to compute hash of file."));
707  return;
708  }
709  uc->file_id = *file_id;
713 }
static void signal_unindex_error(struct GNUNET_FS_UnindexContext *uc)
We&#39;ve encountered an error during unindexing.
Definition: fs_unindex.c:138
void GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc)
Clean up after completion of an unindex operation.
Definition: fs_unindex.c:833
static struct GNUNET_FS_UnindexContext * uc
struct GNUNET_HashCode file_id
Hash of the file&#39;s contents (once computed).
Definition: fs_api.h:1479
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_CRYPTO_FileHashContext * fhc
Context for hashing of the file.
Definition: fs_api.h:1464
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
void GNUNET_FS_unindex_do_remove_(struct GNUNET_FS_UnindexContext *uc)
Connect to the datastore and remove the blocks.
Definition: fs_unindex.c:645
We&#39;ve encountered a fatal error.
Definition: fs_api.h:1362
void GNUNET_FS_unindex_sync_(struct GNUNET_FS_UnindexContext *uc)
Synchronize this unindex struct with its mirror on disk.
Definition: fs_api.c:1754
We&#39;re currently hashing the file.
Definition: fs_api.h:1330
We&#39;re telling the datastore to delete the respective DBlocks and IBlocks.
Definition: fs_api.h:1336
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_FS_unindex_signal_suspend_()

void GNUNET_FS_unindex_signal_suspend_ ( void *  cls)

Create SUSPEND event for the given unindex operation and then clean up our state (without stop signal).

Parameters
clsthe struct GNUNET_FS_UnindexContext to signal for

Definition at line 723 of file fs_unindex.c.

References GNUNET_FS_UnindexContext::client_info, GNUNET_FS_UnindexContext::dqe, GNUNET_FS_UnindexContext::dscan, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::fh, GNUNET_FS_UnindexContext::fhc, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_break, GNUNET_CRYPTO_hash_file_cancel(), GNUNET_DATASTORE_cancel(), GNUNET_DATASTORE_disconnect(), GNUNET_DISK_file_close(), GNUNET_free, GNUNET_free_non_null, GNUNET_FS_directory_scan_abort(), GNUNET_FS_end_top(), GNUNET_FS_STATUS_UNINDEX_SUSPEND, GNUNET_FS_tree_encoder_finish(), GNUNET_FS_unindex_make_status_(), GNUNET_FS_uri_destroy(), GNUNET_MQ_destroy(), GNUNET_NO, GNUNET_FS_UnindexContext::h, GNUNET_FS_UnindexContext::ksk_uri, GNUNET_FS_UnindexContext::mq, GNUNET_FS_UnindexContext::serialization, GNUNET_FS_UnindexContext::state, GNUNET_FS_ProgressInfo::status, GNUNET_FS_UnindexContext::tc, GNUNET_FS_UnindexContext::top, uc, and UNINDEX_STATE_COMPLETE.

Referenced by deserialize_unindex_file(), and GNUNET_FS_unindex_start().

724 {
725  struct GNUNET_FS_UnindexContext *uc = cls;
726  struct GNUNET_FS_ProgressInfo pi;
727 
728  /* FIXME: lots of duplication with unindex_stop here! */
729  if (uc->dscan != NULL)
730  {
732  uc->dscan = NULL;
733  }
734  if (NULL != uc->dqe)
735  {
737  uc->dqe = NULL;
738  }
739  if (uc->fhc != NULL)
740  {
742  uc->fhc = NULL;
743  }
744  if (NULL != uc->ksk_uri)
745  {
747  uc->ksk_uri = NULL;
748  }
749  if (NULL != uc->mq)
750  {
751  GNUNET_MQ_destroy (uc->mq);
752  uc->mq = NULL;
753  }
754  if (NULL != uc->dsh)
755  {
757  uc->dsh = NULL;
758  }
759  if (NULL != uc->tc)
760  {
761  GNUNET_FS_tree_encoder_finish (uc->tc, NULL);
762  uc->tc = NULL;
763  }
764  if (uc->fh != NULL)
765  {
767  uc->fh = NULL;
768  }
769  GNUNET_FS_end_top (uc->h, uc->top);
772  (uc->state ==
773  UNINDEX_STATE_COMPLETE) ? uc->file_size : 0);
774  GNUNET_break (NULL == uc->client_info);
775  GNUNET_free (uc->filename);
778  GNUNET_free (uc);
779 }
char * serialization
Short name under which we are serializing the state of this operation.
Definition: fs_api.h:1411
int GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h)
Close an open file.
Definition: disk.c:1817
struct GNUNET_FS_TreeEncoder * tc
Merkle-ish tree encoder context.
Definition: fs_api.h:1433
We&#39;re done.
Definition: fs_api.h:1357
static struct GNUNET_FS_UnindexContext * uc
#define GNUNET_NO
Definition: gnunet_common.h:81
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
Notification that we suspended unindexing a file.
enum UnindexState state
Current operatinonal phase.
Definition: fs_api.h:1484
static struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
Handle for controlling an unindexing operation.
Definition: fs_api.h:1369
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service, only valid during the UNINDEX_STATE_DS_NOTIFY phase...
Definition: fs_api.h:1423
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
struct GNUNET_CRYPTO_FileHashContext * fhc
Context for hashing of the file.
Definition: fs_api.h:1464
struct TopLevelActivity * top
Our top-level activity entry.
Definition: fs_api.h:1386
struct GNUNET_DISK_FileHandle * fh
Handle used to read the file.
Definition: fs_api.h:1438
void GNUNET_FS_end_top(struct GNUNET_FS_Handle *h, struct TopLevelActivity *top)
Destroy a top-level activity entry.
Definition: fs_api.c:416
void GNUNET_CRYPTO_hash_file_cancel(struct GNUNET_CRYPTO_FileHashContext *fhc)
Cancel a file hashing operation.
void GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds)
Abort the scan.
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
Definition: fs_uri.c:670
struct GNUNET_FS_Uri * ksk_uri
Keywords found (telling us which KBlocks to remove).
Definition: fs_api.h:1396
char * filename
Name of the file that we are unindexing.
Definition: fs_api.h:1406
struct GNUNET_DATASTORE_QueueEntry * dqe
Handle to datastore &#39;get_key&#39; operation issued for obtaining KBlocks.
Definition: fs_api.h:1444
struct GNUNET_MQ_Handle * mq
Connection to the FS service, only valid during the UNINDEX_STATE_FS_NOTIFY phase.
Definition: fs_api.h:1417
void GNUNET_FS_unindex_make_status_(struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset)
Fill in all of the generic fields for an unindex event and call the callback.
Definition: fs_unindex.c:84
void GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe)
Cancel a datastore operation.
void GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, int drop)
Disconnect from the datastore service (and free associated resources).
struct GNUNET_FS_DirScanner * dscan
Directory scanner to find keywords (KBlock removal).
Definition: fs_api.h:1391
char * emsg
Error message, NULL on success.
Definition: fs_api.h:1459
void GNUNET_FS_tree_encoder_finish(struct GNUNET_FS_TreeEncoder *te, char **emsg)
Clean up a tree encoder and return information about possible errors.
Definition: fs_tree.c:444
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:824
void * client_info
Pointer kept for the client.
Definition: fs_api.h:1428
struct GNUNET_FS_Handle * h
Global FS context.
Definition: fs_api.h:1381
#define GNUNET_free(ptr)
Wrapper around free.
Argument given to the progress callback with information about what is going on.
uint64_t file_size
Overall size of the file.
Definition: fs_api.h:1469
Here is the call graph for this function:
Here is the caller graph for this function: