summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-07 14:15:38 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-07 14:15:38 +0000
commite5bd8fb4aa72717b8707a4652f14c0735acb52c4 (patch)
tree08398e22b9408cc24b6b9e6cb360fe04b9eeae05 /src/transport/plugin_transport_http_server.c
parent572bab1ace57fb9d7acbd218d6940cb1e9a0797b (diff)
determine network scope for ATS even if we do not yet have a session and only have an address
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 0000a604d..db483098a 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -3251,7 +3251,7 @@ http_server_plugin_address_to_string (void *cls,
/**
* Function obtain the network type for a session
*
- * @param cls closure ('struct HTTP_Server_Plugin*')
+ * @param cls closure (`struct HTTP_Server_Plugin *`)
* @param session the session
* @return the network type in HBO or #GNUNET_SYSERR
*/
@@ -3264,6 +3264,24 @@ http_server_plugin_get_network (void *cls,
/**
+ * Function obtain the network type for an address.
+ *
+ * @param cls closure (`struct Plugin *`)
+ * @param address the address
+ * @return the network type
+ */
+static enum GNUNET_ATS_Network_Type
+http_server_plugin_get_network_for_address (void *cls,
+ const struct GNUNET_HELLO_Address *address)
+{
+ struct HTTP_Server_Plugin *plugin = cls;
+
+ return http_common_get_network_for_address (plugin->env,
+ address);
+}
+
+
+/**
* Function that will be called whenever the transport service wants to
* notify the plugin that the inbound quota changed and that the plugin
* should update it's delay for the next receive value
@@ -3393,6 +3411,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
api->string_to_address = &http_common_plugin_string_to_address;
api->address_pretty_printer = &http_common_plugin_address_pretty_printer;
api->get_network = &http_server_plugin_get_network;
+ api->get_network_for_address = &http_server_plugin_get_network_for_address;
api->update_session_timeout = &http_server_plugin_update_session_timeout;
api->update_inbound_delay = &http_server_plugin_update_inbound_delay;
api->setup_monitor = &http_server_plugin_setup_monitor;