/*
This file is part of GNUnet.
- (C) 2001-2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2001-2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
/**
* Main state machine task (if active).
*/
-static GNUNET_SCHEDULER_TaskIdentifier tt;
+static struct GNUNET_SCHEDULER_Task * tt;
/**
* Pending #GNUNET_TRANSPORT_get_hello() operation.
if (NULL != address)
{
- if (NULL == ar->result)
+ if (0 != strlen (address))
+ {
+ if (NULL != ar->result)
+ GNUNET_free (ar->result);
ar->result = GNUNET_strdup (address);
+ }
return;
}
ar->atsc = NULL;
if (GNUNET_SYSERR == res)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Failure: Cannot convert address to string for peer `%s'\n"),
- GNUNET_i2s (&ar->pc->peer));
+ _("Failure: Cannot convert address to string for peer `%s'\n"),
+ GNUNET_i2s (&ar->pc->peer));
pc->num_addresses++;
if (pc->num_addresses == pc->address_list_size)
dump_pc (pc);
ar = &pc->address_list[--pc->off];
ar->pc = pc;
ar->expiration = expiration;
+ GNUNET_asprintf (&ar->result,
+ "%s:%u:%u",
+ address->transport_name,
+ address->address_length,
+ address->local_info);
ar->atsc = GNUNET_TRANSPORT_address_to_string (cfg,
address,
no_resolve,
GNUNET_PEERINFO_add_peer_cancel (ac);
ac = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != tt)
+ if (NULL != tt)
{
GNUNET_SCHEDULER_cancel (tt);
- tt = GNUNET_SCHEDULER_NO_TASK;
+ tt = NULL;
}
if (NULL != pic)
{
}
my_hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (hello);
GNUNET_assert (GNUNET_OK ==
- GNUNET_HELLO_get_id (hello,
+ GNUNET_HELLO_get_id (my_hello,
&my_peer_identity));
GNUNET_TRANSPORT_get_hello_cancel (gh);
gh = NULL;
state_machine (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- tt = GNUNET_SCHEDULER_NO_TASK;
+ tt = NULL;
if (NULL != put_uri)
{