This file is part of GNUnet.
Copyright (C) 2009, 2010 GNUnet e.V.
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Affero General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
* @file fs/fs_publish.c
{
pt_size = GNUNET_MIN (max, p->data.dir.dir_size - offset);
dd = p->data.dir.dir_data;
- memcpy (buf, &dd[offset], pt_size);
+ GNUNET_memcpy (buf, &dd[offset], pt_size);
}
else
{
struct GNUNET_FS_PublishContext *pc = cls;
struct GNUNET_FS_FileInformation *p;
const char *emsg = (const char *) &msg[1];
+ char *msgtxt;
GNUNET_MQ_destroy (pc->mq);
pc->mq = NULL;
p = pc->fi_pos;
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("Can not index file `%s': %s. Will try to insert instead.\n"),
- p->filename,
- gettext (emsg));
- p->data.file.do_index = GNUNET_NO;
+ GNUNET_asprintf (&msgtxt,
+ _("Can not index file `%s': %s.\n"),
+ p->filename,
+ gettext (emsg));
+ signal_publish_error (p,
+ pc,
+ msgtxt);
+ GNUNET_free (msgtxt);
GNUNET_FS_file_information_sync_ (p);
- publish_content (pc);
+ GNUNET_FS_publish_sync_ (pc);
}
hash_for_index_cb (void *cls,
const struct GNUNET_HashCode *res)
{
- GNUNET_MQ_hd_fixed_size (index_start_ok,
- GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK,
- struct GNUNET_MessageHeader);
- GNUNET_MQ_hd_var_size (index_start_failed,
- GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED,
- struct GNUNET_MessageHeader);
struct GNUNET_FS_PublishContext *pc = cls;
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_index_start_ok_handler (pc),
- make_index_start_failed_handler (pc),
+ GNUNET_MQ_hd_fixed_size (index_start_ok,
+ GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK,
+ struct GNUNET_MessageHeader,
+ pc),
+ GNUNET_MQ_hd_var_size (index_start_failed,
+ GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED,
+ struct GNUNET_MessageHeader,
+ pc),
GNUNET_MQ_handler_end ()
};
struct GNUNET_FS_FileInformation *p;
GNUNET_assert (fn != NULL);
slen = strlen (fn) + 1;
if (slen >=
- GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct IndexStartMessage))
+ GNUNET_MAX_MESSAGE_SIZE - sizeof (struct IndexStartMessage))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_
GNUNET_free (fn);
return;
}
- pc->mq = GNUNET_CLIENT_connecT (pc->h->cfg,
+ pc->mq = GNUNET_CLIENT_connect (pc->h->cfg,
"fs",
handlers,
&index_mq_error_handler,
p->filename);
}
ism->file_id = *res;
- memcpy (&ism[1],
+ GNUNET_memcpy (&ism[1],
fn,
slen);
GNUNET_free (fn);
static void
create_loc_uri (struct GNUNET_FS_PublishContext *pc)
{
- GNUNET_MQ_hd_fixed_size (signature_response,
- GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE,
- struct ResponseLocSignatureMessage);
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_signature_response_handler (pc),
+ GNUNET_MQ_hd_fixed_size (signature_response,
+ GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE,
+ struct ResponseLocSignatureMessage,
+ pc),
GNUNET_MQ_handler_end ()
};
struct GNUNET_MQ_Envelope *env;
if (NULL != pc->mq)
GNUNET_MQ_destroy (pc->mq);
- pc->mq = GNUNET_CLIENT_connecT (pc->h->cfg,
+ pc->mq = GNUNET_CLIENT_connect (pc->h->cfg,
"fs",
handlers,
&loc_mq_error_handler,
{
kc = GNUNET_FS_uri_ksk_get_keyword_count (*uri);
pc->reserve_entries += kc;
- pc->reserve_space += GNUNET_SERVER_MAX_MESSAGE_SIZE * kc;
+ pc->reserve_space += GNUNET_MAX_MESSAGE_SIZE * kc;
}
pi.status = GNUNET_FS_STATUS_PUBLISH_START;
*client_info = GNUNET_FS_publish_make_status_ (&pi, pc, fi, 0);