summaryrefslogtreecommitdiff
path: root/src/transport/transport_api_offer_hello.c
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
committerng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
commitd41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch)
tree9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/transport/transport_api_offer_hello.c
parenta0fce305c565c0937d917a92712f15e9c5736260 (diff)
uncrustify as demanded.
Diffstat (limited to 'src/transport/transport_api_offer_hello.c')
-rw-r--r--src/transport/transport_api_offer_hello.c81
1 files changed, 39 insertions, 42 deletions
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 <http://www.gnu.org/licenses/>.
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);
}