From d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb Mon Sep 17 00:00:00 2001 From: ng0 Date: Sun, 8 Sep 2019 12:33:09 +0000 Subject: uncrustify as demanded. --- src/transport/transport_api_offer_hello.c | 81 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 42 deletions(-) (limited to 'src/transport/transport_api_offer_hello.c') diff --git a/src/transport/transport_api_offer_hello.c b/src/transport/transport_api_offer_hello.c index c4432af93..89f8d463d 100644 --- a/src/transport/transport_api_offer_hello.c +++ b/src/transport/transport_api_offer_hello.c @@ -11,12 +11,12 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . SPDX-License-Identifier: AGPL3.0-or-later -*/ + */ /** * @file transport/transport_api_offer_hello.c @@ -33,9 +33,7 @@ /** * Entry in linked list for all offer-HELLO requests. */ -struct GNUNET_TRANSPORT_OfferHelloHandle -{ - +struct GNUNET_TRANSPORT_OfferHelloHandle { /** * Transport service handle we use for transmission. */ @@ -50,7 +48,6 @@ struct GNUNET_TRANSPORT_OfferHelloHandle * Closure for @e cont */ void *cls; - }; @@ -60,13 +57,13 @@ struct GNUNET_TRANSPORT_OfferHelloHandle * @param cls the handle for the operation */ static void -finished_hello (void *cls) +finished_hello(void *cls) { struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls; if (NULL != ohh->cont) - ohh->cont (ohh->cls); - GNUNET_TRANSPORT_offer_hello_cancel (ohh); + ohh->cont(ohh->cls); + GNUNET_TRANSPORT_offer_hello_cancel(ohh); } @@ -78,51 +75,51 @@ finished_hello (void *cls) * @param cfg configuration * @param hello the hello message * @param cont continuation to call when HELLO has been sent, - * tc reason #GNUNET_SCHEDULER_REASON_TIMEOUT for fail - * tc reasong #GNUNET_SCHEDULER_REASON_READ_READY for success + * tc reason #GNUNET_SCHEDULER_REASON_TIMEOUT for fail + * tc reasong #GNUNET_SCHEDULER_REASON_READ_READY for success * @param cont_cls closure for @a cont * @return a `struct GNUNET_TRANSPORT_OfferHelloHandle` handle or NULL on failure, * in case of failure @a cont will not be called * */ struct GNUNET_TRANSPORT_OfferHelloHandle * -GNUNET_TRANSPORT_offer_hello (const struct GNUNET_CONFIGURATION_Handle *cfg, - const struct GNUNET_MessageHeader *hello, - GNUNET_SCHEDULER_TaskCallback cont, - void *cont_cls) +GNUNET_TRANSPORT_offer_hello(const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_MessageHeader *hello, + GNUNET_SCHEDULER_TaskCallback cont, + void *cont_cls) { struct GNUNET_TRANSPORT_OfferHelloHandle *ohh - = GNUNET_new (struct GNUNET_TRANSPORT_OfferHelloHandle); + = GNUNET_new(struct GNUNET_TRANSPORT_OfferHelloHandle); struct GNUNET_MQ_Envelope *env; struct GNUNET_PeerIdentity peer; if (GNUNET_OK != - GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) hello, - &peer)) - { - GNUNET_break (0); - GNUNET_free (ohh); - return NULL; - } - ohh->mq = GNUNET_CLIENT_connect (cfg, - "transport", - NULL, - NULL, - ohh); + GNUNET_HELLO_get_id((const struct GNUNET_HELLO_Message *)hello, + &peer)) + { + GNUNET_break(0); + GNUNET_free(ohh); + return NULL; + } + ohh->mq = GNUNET_CLIENT_connect(cfg, + "transport", + NULL, + NULL, + ohh); if (NULL == ohh->mq) - { - GNUNET_free (ohh); - return NULL; - } + { + GNUNET_free(ohh); + return NULL; + } ohh->cont = cont; ohh->cls = cont_cls; - GNUNET_break (ntohs (hello->type) == GNUNET_MESSAGE_TYPE_HELLO); - env = GNUNET_MQ_msg_copy (hello); - GNUNET_MQ_notify_sent (env, - &finished_hello, - ohh); - GNUNET_MQ_send (ohh->mq, - env); + GNUNET_break(ntohs(hello->type) == GNUNET_MESSAGE_TYPE_HELLO); + env = GNUNET_MQ_msg_copy(hello); + GNUNET_MQ_notify_sent(env, + &finished_hello, + ohh); + GNUNET_MQ_send(ohh->mq, + env); return ohh; } @@ -133,10 +130,10 @@ GNUNET_TRANSPORT_offer_hello (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param ohh the handle for the operation to cancel */ void -GNUNET_TRANSPORT_offer_hello_cancel (struct GNUNET_TRANSPORT_OfferHelloHandle *ohh) +GNUNET_TRANSPORT_offer_hello_cancel(struct GNUNET_TRANSPORT_OfferHelloHandle *ohh) { - GNUNET_MQ_destroy (ohh->mq); - GNUNET_free (ohh); + GNUNET_MQ_destroy(ohh->mq); + GNUNET_free(ohh); } -- cgit v1.2.3