diff options
Diffstat (limited to 'src/peerinfo/perf_peerinfo_api.c')
-rwxr-xr-x | src/peerinfo/perf_peerinfo_api.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c index d9107c8fe..c4e6dcc12 100755 --- a/src/peerinfo/perf_peerinfo_api.c +++ b/src/peerinfo/perf_peerinfo_api.c | |||
@@ -46,9 +46,12 @@ static struct GNUNET_PEERINFO_Handle *h; | |||
46 | 46 | ||
47 | static unsigned int numpeers; | 47 | static unsigned int numpeers; |
48 | 48 | ||
49 | static struct GNUNET_PeerIdentity pid; | ||
50 | |||
51 | |||
49 | static int | 52 | static int |
50 | check_it (void *cls, const char *tname, struct GNUNET_TIME_Absolute expiration, | 53 | check_it (void *cls, |
51 | const void *addr, uint16_t addrlen) | 54 | const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration) |
52 | { | 55 | { |
53 | #if DEBUG | 56 | #if DEBUG |
54 | if (addrlen > 0) | 57 | if (addrlen > 0) |
@@ -65,19 +68,22 @@ address_generator (void *cls, size_t max, void *buf) | |||
65 | { | 68 | { |
66 | size_t *agc = cls; | 69 | size_t *agc = cls; |
67 | size_t ret; | 70 | size_t ret; |
68 | char *address; | 71 | char *caddress; |
72 | struct GNUNET_HELLO_Address address; | ||
69 | 73 | ||
70 | if (*agc == 0) | 74 | if (*agc == 0) |
71 | return 0; | 75 | return 0; |
72 | 76 | ||
73 | GNUNET_asprintf (&address, "Address%d", *agc); | 77 | GNUNET_asprintf (&caddress, "Address%d", *agc); |
74 | 78 | address.peer = pid; | |
79 | address.address_length = strlen (caddress) + 1; | ||
80 | address.address = caddress; | ||
81 | address.transport_name = "peerinfotest"; | ||
75 | ret = | 82 | ret = |
76 | GNUNET_HELLO_add_address ("peerinfotest", | 83 | GNUNET_HELLO_add_address (&address, |
77 | GNUNET_TIME_relative_to_absolute | 84 | GNUNET_TIME_relative_to_absolute |
78 | (GNUNET_TIME_UNIT_HOURS), address, | 85 | (GNUNET_TIME_UNIT_HOURS), buf, max); |
79 | strlen (address) + 1, buf, max); | 86 | GNUNET_free (caddress); |
80 | GNUNET_free (address); | ||
81 | *agc = 0; | 87 | *agc = 0; |
82 | return ret; | 88 | return ret; |
83 | } | 89 | } |
@@ -87,7 +93,6 @@ static void | |||
87 | add_peer (size_t i) | 93 | add_peer (size_t i) |
88 | { | 94 | { |
89 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 95 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; |
90 | struct GNUNET_PeerIdentity pid; | ||
91 | struct GNUNET_HELLO_Message *h2; | 96 | struct GNUNET_HELLO_Message *h2; |
92 | 97 | ||
93 | memset (&pkey, i, sizeof (pkey)); | 98 | memset (&pkey, i, sizeof (pkey)); |