aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api_address_iterate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport_api_address_iterate.c')
-rw-r--r--src/transport/transport_api_address_iterate.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/transport/transport_api_address_iterate.c b/src/transport/transport_api_address_iterate.c
index da333798f..a5b4251c5 100644
--- a/src/transport/transport_api_address_iterate.c
+++ b/src/transport/transport_api_address_iterate.c
@@ -80,7 +80,10 @@ peer_address_response_processor (void *cls,
80 struct AddressLookupCtx *alucb = cls; 80 struct AddressLookupCtx *alucb = cls;
81 struct AddressIterateResponseMessage *address; 81 struct AddressIterateResponseMessage *address;
82 uint16_t size; 82 uint16_t size;
83 83 char * transport;
84 size_t transport_len;
85 //void * addr;
86 size_t addrlen;
84 87
85 if (msg == NULL) 88 if (msg == NULL)
86 { 89 {
@@ -103,7 +106,7 @@ peer_address_response_processor (void *cls,
103 GNUNET_free (alucb); 106 GNUNET_free (alucb);
104 return; 107 return;
105 } 108 }
106 if (size != sizeof (struct AddressIterateResponseMessage)) 109 if (size < sizeof (struct AddressIterateResponseMessage))
107 { 110 {
108 /* invalid reply */ 111 /* invalid reply */
109 GNUNET_break (0); 112 GNUNET_break (0);
@@ -113,15 +116,16 @@ peer_address_response_processor (void *cls,
113 return; 116 return;
114 } 117 }
115 118
116 address = (struct AddressIterateResponseMessage *) msg; 119 address = (struct AddressIterateResponseMessage *) &msg[1];
117 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PEER: %s\n",
118 GNUNET_i2s (&address->peer));
119 120
121 transport = (char *) &address[0];
122 transport_len = ntohs(address->pluginlen);
123 addrlen = ntohs(address->addrlen);
120 124
121 /* expect more replies */ 125 /* expect more replies */
122 GNUNET_CLIENT_receive (alucb->client, &peer_address_response_processor, alucb, 126 GNUNET_CLIENT_receive (alucb->client, &peer_address_response_processor, alucb,
123 GNUNET_TIME_absolute_get_remaining (alucb->timeout)); 127 GNUNET_TIME_absolute_get_remaining (alucb->timeout));
124 alucb->cb (alucb->cb_cls, &address->peer, NULL, NULL, 0); 128 alucb->cb (alucb->cb_cls, &address->peer, transport, NULL, addrlen);
125} 129}
126 130
127 131