aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_scheduling.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r--src/ats/ats_api_scheduling.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index bc730b248..d7e305950 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -118,11 +118,6 @@ struct GNUNET_ATS_SchedulingHandle
118 void *suggest_cb_cls; 118 void *suggest_cb_cls;
119 119
120 /** 120 /**
121 * Connection to ATS service.
122 */
123 struct GNUNET_CLIENT_Connection *client;
124
125 /**
126 * Message queue for sending requests to the ATS service. 121 * Message queue for sending requests to the ATS service.
127 */ 122 */
128 struct GNUNET_MQ_Handle *mq; 123 struct GNUNET_MQ_Handle *mq;
@@ -190,11 +185,6 @@ force_reconnect (struct GNUNET_ATS_SchedulingHandle *sh)
190 GNUNET_MQ_destroy (sh->mq); 185 GNUNET_MQ_destroy (sh->mq);
191 sh->mq = NULL; 186 sh->mq = NULL;
192 } 187 }
193 if (NULL != sh->client)
194 {
195 GNUNET_CLIENT_disconnect (sh->client);
196 sh->client = NULL;
197 }
198 sh->suggest_cb (sh->suggest_cb_cls, 188 sh->suggest_cb (sh->suggest_cb_cls,
199 NULL, NULL, NULL, 189 NULL, NULL, NULL,
200 GNUNET_BANDWIDTH_ZERO, 190 GNUNET_BANDWIDTH_ZERO,
@@ -539,17 +529,18 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh)
539 struct ClientStartMessage *init; 529 struct ClientStartMessage *init;
540 unsigned int i; 530 unsigned int i;
541 struct GNUNET_ATS_AddressRecord *ar; 531 struct GNUNET_ATS_AddressRecord *ar;
532 struct GNUNET_CLIENT_Connection *client;
542 533
543 GNUNET_assert (NULL == sh->client); 534 GNUNET_assert (NULL == sh->mq);
544 sh->client = GNUNET_CLIENT_connect ("ats", 535 client = GNUNET_CLIENT_connect ("ats",
545 sh->cfg); 536 sh->cfg);
546 if (NULL == sh->client) 537 if (NULL == client)
547 { 538 {
548 GNUNET_break (0); 539 GNUNET_break (0);
549 force_reconnect (sh); 540 force_reconnect (sh);
550 return; 541 return;
551 } 542 }
552 sh->mq = GNUNET_MQ_queue_for_connection_client (sh->client, 543 sh->mq = GNUNET_MQ_queue_for_connection_client (client,
553 handlers, 544 handlers,
554 &error_handler, 545 &error_handler,
555 sh); 546 sh);
@@ -614,11 +605,6 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh)
614 GNUNET_MQ_destroy (sh->mq); 605 GNUNET_MQ_destroy (sh->mq);
615 sh->mq = NULL; 606 sh->mq = NULL;
616 } 607 }
617 if (NULL != sh->client)
618 {
619 GNUNET_CLIENT_disconnect (sh->client);
620 sh->client = NULL;
621 }
622 if (NULL != sh->task) 608 if (NULL != sh->task)
623 { 609 {
624 GNUNET_SCHEDULER_cancel (sh->task); 610 GNUNET_SCHEDULER_cancel (sh->task);