diff options
Diffstat (limited to 'src/transport/plugin_transport_http_new.c')
-rw-r--r-- | src/transport/plugin_transport_http_new.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_http_new.c b/src/transport/plugin_transport_http_new.c index da401575b..37fae8972 100644 --- a/src/transport/plugin_transport_http_new.c +++ b/src/transport/plugin_transport_http_new.c | |||
@@ -306,6 +306,8 @@ http_plugin_address_suggested (void *cls, const void *addr, size_t addrlen) | |||
306 | const char * | 306 | const char * |
307 | http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | 307 | http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) |
308 | { | 308 | { |
309 | struct Plugin *plugin = cls; | ||
310 | |||
309 | const struct IPv4HttpAddress *t4; | 311 | const struct IPv4HttpAddress *t4; |
310 | const struct IPv6HttpAddress *t6; | 312 | const struct IPv6HttpAddress *t6; |
311 | struct sockaddr_in a4; | 313 | struct sockaddr_in a4; |
@@ -315,6 +317,8 @@ http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
315 | uint16_t port; | 317 | uint16_t port; |
316 | int res; | 318 | int res; |
317 | 319 | ||
320 | GNUNET_assert (plugin != NULL); | ||
321 | |||
318 | if (addrlen == sizeof (struct IPv6HttpAddress)) | 322 | if (addrlen == sizeof (struct IPv6HttpAddress)) |
319 | { | 323 | { |
320 | address = GNUNET_malloc (INET6_ADDRSTRLEN); | 324 | address = GNUNET_malloc (INET6_ADDRSTRLEN); |
@@ -338,8 +342,10 @@ http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
338 | } | 342 | } |
339 | 343 | ||
340 | GNUNET_assert (strlen (address) + 7 < (INET6_ADDRSTRLEN + 13)); | 344 | GNUNET_assert (strlen (address) + 7 < (INET6_ADDRSTRLEN + 13)); |
341 | 345 | if (addrlen == sizeof (struct IPv6HttpAddress)) | |
342 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s:%u", address, port); | 346 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://[%s]:%u/", plugin->protocol, address, port); |
347 | else if (addrlen == sizeof (struct IPv4HttpAddress)) | ||
348 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://%s:%u/", plugin->protocol, address, port); | ||
343 | 349 | ||
344 | GNUNET_free (address); | 350 | GNUNET_free (address); |
345 | GNUNET_assert (res != 0); | 351 | GNUNET_assert (res != 0); |