diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-19 22:53:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-19 22:53:13 +0000 |
commit | 8a5989dc2700e8d470967e51c1f3085f095aed12 (patch) | |
tree | 6a7d35fdb5c80e94eab220735827a984270b4f38 /src/ats | |
parent | 42f625fe75fce04175965b12d1edb809b56433af (diff) | |
download | gnunet-8a5989dc2700e8d470967e51c1f3085f095aed12.tar.gz gnunet-8a5989dc2700e8d470967e51c1f3085f095aed12.zip |
avoid deprecated API, use new connecT API
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/ats_api_connectivity.c | 15 | ||||
-rw-r--r-- | src/ats/ats_api_scheduling.c | 14 |
2 files changed, 13 insertions, 16 deletions
diff --git a/src/ats/ats_api_connectivity.c b/src/ats/ats_api_connectivity.c index 139f50a81..790d3e4cb 100644 --- a/src/ats/ats_api_connectivity.c +++ b/src/ats/ats_api_connectivity.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2015 GNUnet e.V. | 3 | Copyright (C) 2010-2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -193,19 +193,18 @@ reconnect (struct GNUNET_ATS_ConnectivityHandle *ch) | |||
193 | { { NULL, 0, 0 } }; | 193 | { { NULL, 0, 0 } }; |
194 | struct GNUNET_MQ_Envelope *ev; | 194 | struct GNUNET_MQ_Envelope *ev; |
195 | struct ClientStartMessage *init; | 195 | struct ClientStartMessage *init; |
196 | struct GNUNET_CLIENT_Connection *client; | ||
197 | 196 | ||
198 | GNUNET_assert (NULL == ch->mq); | 197 | GNUNET_assert (NULL == ch->mq); |
199 | client = GNUNET_CLIENT_connect ("ats", ch->cfg); | 198 | ch->mq = GNUNET_CLIENT_connecT (ch->cfg, |
200 | if (NULL == client) | 199 | "ats", |
200 | handlers, | ||
201 | &error_handler, | ||
202 | ch); | ||
203 | if (NULL == ch->mq) | ||
201 | { | 204 | { |
202 | force_reconnect (ch); | 205 | force_reconnect (ch); |
203 | return; | 206 | return; |
204 | } | 207 | } |
205 | ch->mq = GNUNET_MQ_queue_for_connection_client (client, | ||
206 | handlers, | ||
207 | &error_handler, | ||
208 | ch); | ||
209 | ev = GNUNET_MQ_msg (init, | 208 | ev = GNUNET_MQ_msg (init, |
210 | GNUNET_MESSAGE_TYPE_ATS_START); | 209 | GNUNET_MESSAGE_TYPE_ATS_START); |
211 | init->start_flag = htonl (START_FLAG_CONNECTION_SUGGESTION); | 210 | init->start_flag = htonl (START_FLAG_CONNECTION_SUGGESTION); |
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index d7e305950..bcca89456 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -529,21 +529,19 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh) | |||
529 | struct ClientStartMessage *init; | 529 | struct ClientStartMessage *init; |
530 | unsigned int i; | 530 | unsigned int i; |
531 | struct GNUNET_ATS_AddressRecord *ar; | 531 | struct GNUNET_ATS_AddressRecord *ar; |
532 | struct GNUNET_CLIENT_Connection *client; | ||
533 | 532 | ||
534 | GNUNET_assert (NULL == sh->mq); | 533 | GNUNET_assert (NULL == sh->mq); |
535 | client = GNUNET_CLIENT_connect ("ats", | 534 | sh->mq = GNUNET_CLIENT_connecT (sh->cfg, |
536 | sh->cfg); | 535 | "ats", |
537 | if (NULL == client) | 536 | handlers, |
537 | &error_handler, | ||
538 | sh); | ||
539 | if (NULL == sh->mq) | ||
538 | { | 540 | { |
539 | GNUNET_break (0); | 541 | GNUNET_break (0); |
540 | force_reconnect (sh); | 542 | force_reconnect (sh); |
541 | return; | 543 | return; |
542 | } | 544 | } |
543 | sh->mq = GNUNET_MQ_queue_for_connection_client (client, | ||
544 | handlers, | ||
545 | &error_handler, | ||
546 | sh); | ||
547 | ev = GNUNET_MQ_msg (init, | 545 | ev = GNUNET_MQ_msg (init, |
548 | GNUNET_MESSAGE_TYPE_ATS_START); | 546 | GNUNET_MESSAGE_TYPE_ATS_START); |
549 | init->start_flag = htonl (START_FLAG_SCHEDULING); | 547 | init->start_flag = htonl (START_FLAG_SCHEDULING); |