const struct GNUNET_FS_FileInformation *p,
uint64_t offset)
{
- pi->value.publish.sc = sc;
+ pi->value.publish.pc = sc;
pi->value.publish.fi = p;
pi->value.publish.cctx
= p->client_info;
if (NULL != emsg)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Error uploading KSK blocks: %s\n",
+ emsg);
+#endif
signal_publish_error (p, pc, emsg);
GNUNET_FS_file_information_sync_ (p);
GNUNET_FS_publish_sync_ (pc);
pc);
return;
}
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "KSK blocks published, moving on to next file\n");
+#endif
if (NULL != p->dir)
signal_publish_completion (p, pc);
/* move on to next file */
struct GNUNET_FS_FileInformation *p;
struct GNUNET_FS_ProgressInfo pi;
char *emsg;
-
+
p = sc->fi_pos;
GNUNET_FS_tree_encoder_finish (p->te,
&p->chk_uri,
p->te = NULL;
if (NULL != emsg)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Error during tree walk: %s\n",
+ emsg);
+#endif
GNUNET_asprintf (&p->emsg,
_("Upload failed: %s"),
emsg);
pi.value.publish.specifics.error.message = p->emsg;
p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0);
}
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Finished with tree encoder\n");
+#endif
/* continue with main */
sc->upload_task
= GNUNET_SCHEDULER_add_with_priority (sc->h->sched,
p = sc->fi_pos;
if (NULL == sc->dsh)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Waiting for datastore connection\n");
+#endif
sc->upload_task
= GNUNET_SCHEDULER_add_with_priority (sc->h->sched,
GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
{
if (p->is_directory)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Creating directory\n");
+#endif
db = GNUNET_FS_directory_builder_create (p->meta);
dirpos = p->data.dir.entries;
while (NULL != dirpos)
size = (p->is_directory)
? p->data.dir.dir_size
: p->data.file.file_size;
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Creating tree encoder\n");
+#endif
p->te = GNUNET_FS_tree_encoder_create (sc->h,
size,
sc,
&encode_cont);
}
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Processing next block from tree\n");
+#endif
GNUNET_FS_tree_encoder_next (p->te);
}
return;
}
fn = GNUNET_STRINGS_filename_expand (p->filename);
+ GNUNET_assert (fn != NULL);
slen = strlen (fn) + 1;
- if (slen > GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof(struct IndexStartMessage))
+ if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof(struct IndexStartMessage))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Can not index file `%s': %s. Will try to insert instead.\n"),
#if DEBUG_PUBLISH
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Hash of indexed file `%s' is `%s'\n",
- p->data.file.filename,
+ p->filename,
GNUNET_h2s (res));
#endif
client = GNUNET_CLIENT_connect (sc->h->sched,
p = pc->fi_pos;
if (NULL == p)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Upload complete, now publishing SKS and KSK blocks.\n");
+#endif
/* upload of entire hierarchy complete,
publish namespace entries */
GNUNET_FS_publish_sync_ (pc);
/* abort on error */
if (NULL != p->emsg)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Error uploading: %s\n",
+ p->emsg);
+#endif
/* error with current file, abort all
related files as well! */
while (NULL != p->dir)
/* handle completion */
if (NULL != p->chk_uri)
{
+#if DEBUG_PUBLISH
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "File upload complete, now publishing KSK blocks.\n");
+#endif
GNUNET_FS_publish_sync_ (pc);
/* upload of "p" complete, publish KBlocks! */
if (p->keywords != NULL)
* @param uri pointer to the keywords that will be used for this entry (can be modified)
* @param anonymity pointer to selected anonymity level (can be modified)
* @param priority pointer to selected priority (can be modified)
+ * @param do_index should we index?
* @param expirationTime pointer to selected expiration time (can be modified)
* @param client_info pointer to client context set upon creation (can be modified)
* @return GNUNET_OK to continue (always)
struct GNUNET_FS_Uri **uri,
uint32_t *anonymity,
uint32_t *priority,
+ int *do_index,
struct GNUNET_TIME_Absolute *expirationTime,
void **client_info)
{
* @param uri pointer to the keywords that will be used for this entry (can be modified)
* @param anonymity pointer to selected anonymity level (can be modified)
* @param priority pointer to selected priority (can be modified)
+ * @param do_index should we index?
* @param expirationTime pointer to selected expiration time (can be modified)
* @param client_info pointer to client context set upon creation (can be modified)
* @return GNUNET_OK to continue (always)
struct GNUNET_FS_Uri **uri,
uint32_t *anonymity,
uint32_t *priority,
+ int *do_index,
struct GNUNET_TIME_Absolute *expirationTime,
void **client_info)
{
* @param uri pointer to the keywords that will be used for this entry (can be modified)
* @param anonymity pointer to selected anonymity level (can be modified)
* @param priority pointer to selected priority (can be modified)
+ * @param do_index should we index?
* @param expirationTime pointer to selected expiration time (can be modified)
* @param client_info pointer to client context set upon creation (can be modified)
* @return GNUNET_OK to continue (always)
struct GNUNET_FS_Uri **uri,
uint32_t *anonymity,
uint32_t *priority,
+ int *do_index,
struct GNUNET_TIME_Absolute *expirationTime,
void **client_info)
{
&iv,
&pkc->cpy[1]);
pk = GNUNET_CRYPTO_rsa_key_create_from_hash (&key);
+ GNUNET_assert (NULL != pk);
GNUNET_CRYPTO_rsa_key_get_public (pk, &pkc->cpy->keyspace);
GNUNET_CRYPTO_hash (&pkc->cpy->keyspace,
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),