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.c
diff --git
a/src/ats/gnunet-service-ats.c
b/src/ats/gnunet-service-ats.c
index a68ec416b29c5876dc16bf6d2a7d654cc8e4947e..3218769a66570267b93e5b4baa74aa324fa150c6 100644
(file)
--- a/
src/ats/gnunet-service-ats.c
+++ b/
src/ats/gnunet-service-ats.c
@@
-39,6
+39,10
@@
*/
struct GNUNET_STATISTICS_Handle *GSA_stats;
*/
struct GNUNET_STATISTICS_Handle *GSA_stats;
+static struct GNUNET_SERVER_Handle *GSA_server;
+
+struct GAS_Addresses_Handle *GSA_addresses;
+
/**
* We have received a 'ClientStartMessage' from a client. Find out which
* type of client it is and notify the respective subsystem.
/**
* We have received a 'ClientStartMessage' from a client. Find out which
* type of client it is and notify the respective subsystem.
@@
-54,7
+58,6
@@
handle_ats_start (void *cls, struct GNUNET_SERVER_Client *client,
const struct ClientStartMessage *msg =
(const struct ClientStartMessage *) message;
enum StartFlag flag;
const struct ClientStartMessage *msg =
(const struct ClientStartMessage *) message;
enum StartFlag flag;
-
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "ATS_START");
flag = ntohl (msg->start_flag);
switch (flag)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "ATS_START");
flag = ntohl (msg->start_flag);
switch (flag)
@@
-107,10
+110,11
@@
client_disconnect_handler (void *cls, struct GNUNET_SERVER_Client *client)
static void
cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
static void
cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GAS_addresses_done ();
+ GAS_addresses_done (
GSA_addresses
);
GAS_scheduling_done ();
GAS_performance_done ();
GAS_reservations_done ();
GAS_scheduling_done ();
GAS_performance_done ();
GAS_reservations_done ();
+ GNUNET_SERVER_disconnect_notify_cancel (GSA_server, &client_disconnect_handler, NULL);
if (NULL != GSA_stats)
{
GNUNET_STATISTICS_destroy (GSA_stats, GNUNET_NO);
if (NULL != GSA_stats)
{
GNUNET_STATISTICS_destroy (GSA_stats, GNUNET_NO);
@@
-139,6
+143,11
@@
run (void *cls, struct GNUNET_SERVER_Handle *server,
{&GAS_handle_request_address_cancel, NULL,
GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS_CANCEL,
sizeof (struct RequestAddressMessage)},
{&GAS_handle_request_address_cancel, NULL,
GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS_CANCEL,
sizeof (struct RequestAddressMessage)},
+ {&GAS_handle_request_address_list, NULL,
+ GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_REQUEST,
+ sizeof (struct AddressListRequestMessage)},
+ {&GAS_handle_address_add, NULL,
+ GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD, 0},
{&GAS_handle_address_update, NULL,
GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE, 0},
{&GAS_handle_address_in_use, NULL,
{&GAS_handle_address_update, NULL,
GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE, 0},
{&GAS_handle_address_in_use, NULL,
@@
-150,13
+159,18
@@
run (void *cls, struct GNUNET_SERVER_Handle *server,
sizeof (struct ReservationRequestMessage)},
{&GAS_handle_preference_change, NULL,
GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
sizeof (struct ReservationRequestMessage)},
{&GAS_handle_preference_change, NULL,
GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
+ {&GAS_handle_reset_backoff, NULL,
+ GNUNET_MESSAGE_TYPE_ATS_RESET_BACKOFF,
+ sizeof (struct ResetBackoffMessage)},
{NULL, NULL, 0, 0}
};
{NULL, NULL, 0, 0}
};
+ GSA_server = server;
GSA_stats = GNUNET_STATISTICS_create ("ats", cfg);
GAS_reservations_init ();
GSA_stats = GNUNET_STATISTICS_create ("ats", cfg);
GAS_reservations_init ();
- GAS_performance_init (server);
- GAS_scheduling_init (server);
- GAS_addresses_init (cfg, GSA_stats);
+ GSA_addresses = GAS_addresses_init (cfg, GSA_stats);
+ GAS_performance_init (server, GSA_addresses);
+ GAS_scheduling_init (server, GSA_addresses);
+
GNUNET_SERVER_disconnect_notify (server, &client_disconnect_handler, NULL);
GNUNET_SERVER_add_handlers (server, handlers);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,
GNUNET_SERVER_disconnect_notify (server, &client_disconnect_handler, NULL);
GNUNET_SERVER_add_handlers (server, handlers);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,
@@
-175,7
+189,7
@@
int
main (int argc, char *const *argv)
{
return (GNUNET_OK ==
main (int argc, char *const *argv)
{
return (GNUNET_OK ==
- GNUNET_SERVICE_run (argc, argv, "ats", GNUNET_SERVICE_OPTION_
SOFT_SHUTDOWN
,
+ GNUNET_SERVICE_run (argc, argv, "ats", GNUNET_SERVICE_OPTION_
NONE
,
&run, NULL)) ? 0 : 1;
}
&run, NULL)) ? 0 : 1;
}