projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-report error if starting openssl failed
[oweals/gnunet.git]
/
src
/
ats
/
gnunet-service-ats_scheduling.c
diff --git
a/src/ats/gnunet-service-ats_scheduling.c
b/src/ats/gnunet-service-ats_scheduling.c
index a4c04275f09bd55461614173863cf273de19a6c0..4a20f909dbc496a8e915d5224ee98551fcd0f86b 100644
(file)
--- a/
src/ats/gnunet-service-ats_scheduling.c
+++ b/
src/ats/gnunet-service-ats_scheduling.c
@@
-42,6
+42,11
@@
static struct GNUNET_SERVER_NotificationContext *nc;
static struct GNUNET_SERVER_Client *my_client;
static struct GNUNET_SERVER_Client *my_client;
+/**
+ * Handle to address subsystem
+ */
+static struct GAS_Addresses_Handle *address_handle;
+
/**
* Register a new scheduling client.
*
/**
* Register a new scheduling client.
*
@@
-74,7
+79,7
@@
GAS_scheduling_remove_client (struct GNUNET_SERVER_Client *client)
{
if (my_client != client)
return;
{
if (my_client != client)
return;
- GAS_addresses_destroy_all ();
+ GAS_addresses_destroy_all (
address_handle
);
my_client = NULL;
}
my_client = NULL;
}
@@
-166,10
+171,8
@@
GAS_handle_request_address (void *cls, struct GNUNET_SERVER_Client *client,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n",
"REQUEST_ADDRESS");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n",
"REQUEST_ADDRESS");
- GNUNET_STATISTICS_update (GSA_stats, "# address requests received", 1,
- GNUNET_NO);
GNUNET_break (0 == ntohl (msg->reserved));
GNUNET_break (0 == ntohl (msg->reserved));
- GAS_addresses_request_address (&msg->peer);
+ GAS_addresses_request_address (
address_handle,
&msg->peer);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@
-193,7
+196,7
@@
GAS_handle_request_address_cancel (void *cls,
"REQUEST_ADDRESS_CANCEL");
GNUNET_break (0 == ntohl (msg->reserved));
"REQUEST_ADDRESS_CANCEL");
GNUNET_break (0 == ntohl (msg->reserved));
- /* TODO */
+ GAS_addresses_request_address_cancel (address_handle, &msg->peer);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@
-215,10
+218,8
@@
GAS_handle_reset_backoff (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n",
"RESET_BACKOFF");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n",
"RESET_BACKOFF");
- GNUNET_STATISTICS_update (GSA_stats, "# backoff reset requests received", 1,
- GNUNET_NO);
GNUNET_break (0 == ntohl (msg->reserved));
GNUNET_break (0 == ntohl (msg->reserved));
- GAS_addresses_handle_backoff_reset (&msg->peer);
+ GAS_addresses_handle_backoff_reset (
address_handle,
&msg->peer);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@
-275,7
+276,7
@@
GAS_handle_address_add (void *cls, struct GNUNET_SERVER_Client *client,
}
GNUNET_STATISTICS_update (GSA_stats, "# address updates received", 1,
GNUNET_NO);
}
GNUNET_STATISTICS_update (GSA_stats, "# address updates received", 1,
GNUNET_NO);
- GAS_addresses_add (&m->peer, plugin_name, address, address_length,
+ GAS_addresses_add (
address_handle,
&m->peer, plugin_name, address, address_length,
ntohl (m->session_id), atsi, ats_count);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
ntohl (m->session_id), atsi, ats_count);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@
-334,7
+335,7
@@
GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
}
GNUNET_STATISTICS_update (GSA_stats, "# address updates received", 1,
GNUNET_NO);
}
GNUNET_STATISTICS_update (GSA_stats, "# address updates received", 1,
GNUNET_NO);
- GAS_addresses_update (&m->peer, plugin_name, address, address_length,
+ GAS_addresses_update (
address_handle,
&m->peer, plugin_name, address, address_length,
ntohl (m->session_id), atsi, ats_count);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
ntohl (m->session_id), atsi, ats_count);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@
-390,12
+391,13
@@
GAS_handle_address_in_use (void *cls, struct GNUNET_SERVER_Client *client,
}
in_use = ntohs (m->in_use);
}
in_use = ntohs (m->in_use);
- res = GAS_addresses_in_use (&m->peer,
- plugin_name,
- address,
- address_length,
- ntohl (m->session_id),
- in_use);
+ res = GAS_addresses_in_use (address_handle,
+ &m->peer,
+ plugin_name,
+ address,
+ address_length,
+ ntohl (m->session_id),
+ in_use);
if (res == GNUNET_OK)
GNUNET_SERVER_receive_done (client, GNUNET_OK);
if (res == GNUNET_OK)
GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@
-460,7
+462,8
@@
GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
return;
}
GNUNET_STATISTICS_update (GSA_stats, "# addresses destroyed", 1, GNUNET_NO);
return;
}
GNUNET_STATISTICS_update (GSA_stats, "# addresses destroyed", 1, GNUNET_NO);
- GAS_addresses_destroy (&m->peer, plugin_name, address, address_length,
+ GAS_addresses_destroy (address_handle, &m->peer, plugin_name,
+ address, address_length,
ntohl (m->session_id));
if (0 != ntohl (m->session_id))
{
ntohl (m->session_id));
if (0 != ntohl (m->session_id))
{
@@
-479,10
+482,12
@@
GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
* Initialize scheduling subsystem.
*
* @param server handle to our server
* Initialize scheduling subsystem.
*
* @param server handle to our server
+ * @param ah the address handle to use
*/
void
*/
void
-GAS_scheduling_init (struct GNUNET_SERVER_Handle *server)
+GAS_scheduling_init (struct GNUNET_SERVER_Handle *server
, struct GAS_Addresses_Handle *ah
)
{
{
+ address_handle = ah;
nc = GNUNET_SERVER_notification_context_create (server, 128);
}
nc = GNUNET_SERVER_notification_context_create (server, 128);
}