aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-17 22:20:18 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-17 22:20:18 +0000
commit81b92caa24a83620032438df9c5ee3ea51663a02 (patch)
tree2b2df659c94e1ead5bbdb5082e50018c39e68796 /src/transport/plugin_transport_http_server.c
parent4756cb0779daf3e4c33b6e876dce956de7ee6dd8 (diff)
downloadgnunet-81b92caa24a83620032438df9c5ee3ea51663a02.tar.gz
gnunet-81b92caa24a83620032438df9c5ee3ea51663a02.zip
simplify ATS API and plugin API by returning the network type, instead of an ATS_Information struct
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index aaa17b2cf..c7c145328 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1423,23 +1423,25 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin,
1423 conn_info->client_addr, 1423 conn_info->client_addr,
1424 sizeof (struct sockaddr_in)); 1424 sizeof (struct sockaddr_in));
1425 addr_len = http_common_address_get_size (addr); 1425 addr_len = http_common_address_get_size (addr);
1426 ats = plugin->env->get_address_type (plugin->env->cls, 1426 ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
1427 conn_info->client_addr, 1427 ats.value = htonl (plugin->env->get_address_type (plugin->env->cls,
1428 sizeof (struct sockaddr_in)); 1428 conn_info->client_addr,
1429 sizeof (struct sockaddr_in)));
1429 break; 1430 break;
1430 case (AF_INET6): 1431 case (AF_INET6):
1431 addr = http_common_address_from_socket (plugin->protocol, 1432 addr = http_common_address_from_socket (plugin->protocol,
1432 conn_info->client_addr, 1433 conn_info->client_addr,
1433 sizeof (struct sockaddr_in6)); 1434 sizeof (struct sockaddr_in6));
1434 addr_len = http_common_address_get_size (addr); 1435 addr_len = http_common_address_get_size (addr);
1435 ats = plugin->env->get_address_type (plugin->env->cls, 1436 ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
1436 conn_info->client_addr, 1437 ats.value = htonl (plugin->env->get_address_type (plugin->env->cls,
1437 sizeof (struct sockaddr_in6)); 1438 conn_info->client_addr,
1439 sizeof (struct sockaddr_in6)));
1438 break; 1440 break;
1439 default: 1441 default:
1440 /* external host name */ 1442 /* external host name */
1441 ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); 1443 ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
1442 ats.type = htonl (GNUNET_ATS_NET_WAN); 1444 ats.value = htonl (GNUNET_ATS_NET_WAN);
1443 return NULL; 1445 return NULL;
1444 } 1446 }
1445 s = GNUNET_new (struct Session); 1447 s = GNUNET_new (struct Session);