diff options
Diffstat (limited to 'src/transport/transport_api_address_to_string.c')
-rw-r--r-- | src/transport/transport_api_address_to_string.c | 10 |
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) | |||
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | GNUNET_break (ntohs (msg->type) == | 78 | GNUNET_break (ntohs (msg->type) == |
79 | GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY); | 79 | GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE_RESPONSE); |
80 | size = ntohs (msg->size); | 80 | size = ntohs (msg->size); |
81 | if (size == sizeof (struct GNUNET_MessageHeader)) | 81 | if (size == sizeof (struct GNUNET_MessageHeader)) |
82 | { | 82 | { |
@@ -108,10 +108,8 @@ address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg) | |||
108 | * | 108 | * |
109 | * @param cfg configuration to use | 109 | * @param cfg configuration to use |
110 | * @param address address to convert (binary format) | 110 | * @param address address to convert (binary format) |
111 | * @param addressLen number of bytes in address | ||
112 | * @param numeric should (IP) addresses be displayed in numeric form | 111 | * @param numeric should (IP) addresses be displayed in numeric form |
113 | * (otherwise do reverse DNS lookup) | 112 | * (otherwise do reverse DNS lookup) |
114 | * @param nameTrans name of the transport to which the address belongs | ||
115 | * @param timeout how long is the lookup allowed to take at most | 113 | * @param timeout how long is the lookup allowed to take at most |
116 | * @param aluc function to call with the results | 114 | * @param aluc function to call with the results |
117 | * @param aluc_cls closure for aluc | 115 | * @param aluc_cls closure for aluc |
@@ -132,6 +130,7 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf | |||
132 | struct GNUNET_CLIENT_Connection *client; | 130 | struct GNUNET_CLIENT_Connection *client; |
133 | char *addrbuf; | 131 | char *addrbuf; |
134 | 132 | ||
133 | GNUNET_assert (address != NULL); | ||
135 | alen = GNUNET_HELLO_address_get_size (address); | 134 | alen = GNUNET_HELLO_address_get_size (address); |
136 | len = sizeof (struct AddressLookupMessage) + alen; | 135 | len = sizeof (struct AddressLookupMessage) + alen; |
137 | if (len >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 136 | if (len >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
@@ -139,12 +138,15 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf | |||
139 | GNUNET_break (0); | 138 | GNUNET_break (0); |
140 | return NULL; | 139 | return NULL; |
141 | } | 140 | } |
141 | |||
142 | client = GNUNET_CLIENT_connect ("transport", cfg); | 142 | client = GNUNET_CLIENT_connect ("transport", cfg); |
143 | if (client == NULL) | 143 | if (client == NULL) |
144 | return NULL; | 144 | return NULL; |
145 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
146 | "GNUNET_TRANSPORT_address_to_string\n"); | ||
145 | msg = GNUNET_malloc (len); | 147 | msg = GNUNET_malloc (len); |
146 | msg->header.size = htons (len); | 148 | msg->header.size = htons (len); |
147 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP); | 149 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING); |
148 | msg->numeric_only = htonl (numeric); | 150 | msg->numeric_only = htonl (numeric); |
149 | msg->timeout = GNUNET_TIME_relative_hton (timeout); | 151 | msg->timeout = GNUNET_TIME_relative_hton (timeout); |
150 | msg->addrlen = htonl (alen); | 152 | msg->addrlen = htonl (alen); |