summaryrefslogtreecommitdiff
path: root/src/transport/transport_api_address_to_string.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-11-29 15:43:11 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-11-29 15:43:11 +0000
commit0c3e3371bcc2dad9c4f14561068a1752f01b1756 (patch)
tree6aa926c5f1ad962594f6c9ad9b238500ad644702 /src/transport/transport_api_address_to_string.c
parentfd2601f3fce6eefbb7e0f9aaca61f9169b25d3f4 (diff)
- latest changes for refactoring: iterate sends disassembled hello-address
Diffstat (limited to 'src/transport/transport_api_address_to_string.c')
-rw-r--r--src/transport/transport_api_address_to_string.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c
index 259c77152..2e5a34ce2 100644
--- a/src/transport/transport_api_address_to_string.c
+++ b/src/transport/transport_api_address_to_string.c
@@ -76,7 +76,7 @@ address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg)
return;
}
GNUNET_break (ntohs (msg->type) ==
- GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY);
+ GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE_RESPONSE);
size = ntohs (msg->size);
if (size == sizeof (struct GNUNET_MessageHeader))
{
@@ -108,10 +108,8 @@ address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg)
*
* @param cfg configuration to use
* @param address address to convert (binary format)
- * @param addressLen number of bytes in address
* @param numeric should (IP) addresses be displayed in numeric form
* (otherwise do reverse DNS lookup)
- * @param nameTrans name of the transport to which the address belongs
* @param timeout how long is the lookup allowed to take at most
* @param aluc function to call with the results
* @param aluc_cls closure for aluc
@@ -132,6 +130,7 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf
struct GNUNET_CLIENT_Connection *client;
char *addrbuf;
+ GNUNET_assert (address != NULL);
alen = GNUNET_HELLO_address_get_size (address);
len = sizeof (struct AddressLookupMessage) + alen;
if (len >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
@@ -139,12 +138,15 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf
GNUNET_break (0);
return NULL;
}
+
client = GNUNET_CLIENT_connect ("transport", cfg);
if (client == NULL)
return NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "GNUNET_TRANSPORT_address_to_string\n");
msg = GNUNET_malloc (len);
msg->header.size = htons (len);
- msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP);
+ msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING);
msg->numeric_only = htonl (numeric);
msg->timeout = GNUNET_TIME_relative_hton (timeout);
msg->addrlen = htonl (alen);