GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUNET_CONTAINER_DLL_insert (*head, *tail, p);
pattern = strstr (pattern, ")");
GNUNET_assert (NULL != pattern);
GNUNET_CONTAINER_DLL_insert (*head, *tail, p);
pattern = strstr (pattern, ")");
GNUNET_assert (NULL != pattern);
return NULL;
/* initialize data with 'unique' data only depending on 'kval' and 'size',
making sure that blocks do not repeat */
return NULL;
/* initialize data with 'unique' data only depending on 'kval' and 'size',
making sure that blocks do not repeat */
{
xor = length ^ kval ^ (uint64_t) (i / 32 / 1024);
memcpy (&data[i], &xor, GNUNET_MIN (length - i, sizeof (uint64_t)));
{
xor = length ^ kval ^ (uint64_t) (i / 32 / 1024);
memcpy (&data[i], &xor, GNUNET_MIN (length - i, sizeof (uint64_t)));
GNUNET_SCHEDULER_cancel (p->stask);
if (NULL != p->ctx)
GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
GNUNET_SCHEDULER_cancel (p->stask);
if (NULL != p->ctx)
GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
case GNUNET_FS_STATUS_PUBLISH_ERROR:
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Publishing failed\n");
case GNUNET_FS_STATUS_PUBLISH_ERROR:
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Publishing failed\n");
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
p = info->value.publish.cctx;
GNUNET_STATISTICS_update (stats_handle,
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
p = info->value.publish.cctx;
GNUNET_STATISTICS_update (stats_handle,
- "# publishing time (ms)",
- (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value,
+ "# publishing time (ms)",
+ (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL,
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
p = info->value.download.cctx;
GNUNET_STATISTICS_update (stats_handle,
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
p = info->value.download.cctx;
GNUNET_STATISTICS_update (stats_handle,
- "# download time (ms)",
- (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value,
- GNUNET_NO); p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p);
+ "# download time (ms)",
+ (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL,
+ GNUNET_NO);
+ p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p);
if (p->y != GNUNET_FS_uri_chk_get_file_size (uri))
return NULL; /* not what we want */
GNUNET_STATISTICS_update (stats_handle,
if (p->y != GNUNET_FS_uri_chk_get_file_size (uri))
return NULL; /* not what we want */
GNUNET_STATISTICS_update (stats_handle,
GNUNET_NO);
p->start_time = GNUNET_TIME_absolute_get ();
p->ctx = GNUNET_FS_download_start (fs_handle, uri,
GNUNET_NO);
p->start_time = GNUNET_TIME_absolute_get ();
p->ctx = GNUNET_FS_download_start (fs_handle, uri,
0, GNUNET_FS_uri_chk_get_file_size (uri),
anonymity_level,
GNUNET_FS_DOWNLOAD_NO_TEMPORARIES,
0, GNUNET_FS_uri_chk_get_file_size (uri),
anonymity_level,
GNUNET_FS_DOWNLOAD_NO_TEMPORARIES,
start_publish (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
struct GNUNET_FS_FileInformation *fi;
start_publish (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
struct GNUNET_FS_FileInformation *fi;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
fi = make_file (p->x, p->y, p);
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
fi = make_file (p->x, p->y, p);
start_download (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
struct GNUNET_FS_Uri *keywords;
start_download (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
struct GNUNET_FS_Uri *keywords;
replication_level = 1;
GNUNET_snprintf (myoptname, sizeof (myoptname),
"DOWNLOAD-PATTERN-%u", my_peerid);
if (GNUNET_OK !=
replication_level = 1;
GNUNET_snprintf (myoptname, sizeof (myoptname),
"DOWNLOAD-PATTERN-%u", my_peerid);
if (GNUNET_OK !=
download_pattern = GNUNET_strdup ("");
GNUNET_snprintf (myoptname, sizeof (myoptname),
"PUBLISH-PATTERN-%u", my_peerid);
if (GNUNET_OK !=
download_pattern = GNUNET_strdup ("");
GNUNET_snprintf (myoptname, sizeof (myoptname),
"PUBLISH-PATTERN-%u", my_peerid);
if (GNUNET_OK !=
publish_pattern = GNUNET_strdup ("");
if ( (GNUNET_OK !=
parse_pattern (&download_head,
publish_pattern = GNUNET_strdup ("");
if ( (GNUNET_OK !=
parse_pattern (&download_head,