aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/perf_peerinfo_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-10 08:28:21 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-10 08:28:21 +0000
commit2e7eb2ae0d5d41e957eefe77435a603773bbb08a (patch)
tree79f60e7e53f6a234d28224a1270e845e8a1108b7 /src/peerinfo/perf_peerinfo_api.c
parent5a2285954d27a47a4f5974154bf2bb271b95d56e (diff)
downloadgnunet-2e7eb2ae0d5d41e957eefe77435a603773bbb08a.tar.gz
gnunet-2e7eb2ae0d5d41e957eefe77435a603773bbb08a.zip
fix
Diffstat (limited to 'src/peerinfo/perf_peerinfo_api.c')
-rwxr-xr-xsrc/peerinfo/perf_peerinfo_api.c25
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
47static unsigned int numpeers; 47static unsigned int numpeers;
48 48
49static struct GNUNET_PeerIdentity pid;
50
51
49static int 52static int
50check_it (void *cls, const char *tname, struct GNUNET_TIME_Absolute expiration, 53check_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
87add_peer (size_t i) 93add_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));