aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-05 12:41:49 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-05 12:41:49 +0000
commit1f3219c222bb206e02a793e6c7d48ccc3045d604 (patch)
tree4ca96c6f9818c75651be78feff42ac7023cedd82 /src
parent3f1bdbec8a40c36da13fd2488e67b8daba49025c (diff)
downloadgnunet-1f3219c222bb206e02a793e6c7d48ccc3045d604.tar.gz
gnunet-1f3219c222bb206e02a793e6c7d48ccc3045d604.zip
indentation, moving API towards MQ-style
Diffstat (limited to 'src')
-rw-r--r--src/dv/dv_api.c9
-rw-r--r--src/dv/gnunet-service-dv.c5
-rw-r--r--src/dv/plugin_transport_dv.c6
-rw-r--r--src/include/gnunet_dv_service.h37
4 files changed, 28 insertions, 29 deletions
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c
index e3ba995c3..d74453376 100644
--- a/src/dv/dv_api.c
+++ b/src/dv/dv_api.c
@@ -308,7 +308,7 @@ cleanup_send_cb (void *cls,
308 while (NULL != (th = peer->head)) 308 while (NULL != (th = peer->head))
309 { 309 {
310 GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, th); 310 GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, th);
311 th->cb (th->cb_cls, GNUNET_SYSERR); 311 th->cb (th->cb_cls);
312 GNUNET_free (th); 312 GNUNET_free (th);
313 } 313 }
314 GNUNET_free (peer); 314 GNUNET_free (peer);
@@ -416,7 +416,7 @@ handle_message_receipt (void *cls,
416 GNUNET_CONTAINER_DLL_remove (sh->th_head, 416 GNUNET_CONTAINER_DLL_remove (sh->th_head,
417 sh->th_tail, 417 sh->th_tail,
418 th); 418 th);
419 th->cb (th->cb_cls, GNUNET_SYSERR); 419 th->cb (th->cb_cls);
420 GNUNET_free (th); 420 GNUNET_free (th);
421 } 421 }
422 } 422 }
@@ -473,10 +473,7 @@ handle_message_receipt (void *cls,
473 GNUNET_CONTAINER_DLL_remove (peer->head, 473 GNUNET_CONTAINER_DLL_remove (peer->head,
474 peer->tail, 474 peer->tail,
475 th); 475 th);
476 th->cb (th->cb_cls, 476 th->cb (th->cb_cls);
477 (ntohs (ack->header.type) == GNUNET_MESSAGE_TYPE_DV_SEND_ACK)
478 ? GNUNET_OK
479 : GNUNET_SYSERR);
480 GNUNET_free (th); 477 GNUNET_free (th);
481 break; 478 break;
482 } 479 }
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index fd51a8562..af6ddb3d9 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -230,7 +230,7 @@ struct DirectNeighbor
230 * ID of the task we use to (periodically) update our consensus 230 * ID of the task we use to (periodically) update our consensus
231 * with this peer. Used if we are the initiating peer. 231 * with this peer. Used if we are the initiating peer.
232 */ 232 */
233 struct GNUNET_SCHEDULER_Task * initiate_task; 233 struct GNUNET_SCHEDULER_Task *initiate_task;
234 234
235 /** 235 /**
236 * At what offset are we, with respect to inserting our own routes 236 * At what offset are we, with respect to inserting our own routes
@@ -1905,7 +1905,8 @@ handle_dv_route_message (void *cls,
1905 * @param message the actual message 1905 * @param message the actual message
1906 */ 1906 */
1907static void 1907static void
1908handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client, 1908handle_dv_send_message (void *cls,
1909 struct GNUNET_SERVER_Client *client,
1909 const struct GNUNET_MessageHeader *message) 1910 const struct GNUNET_MessageHeader *message)
1910{ 1911{
1911 struct Route *route; 1912 struct Route *route;
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index aa94bed31..7293d9fb8 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -519,11 +519,9 @@ handle_dv_disconnect (void *cls,
519 * Clean up the pending request, and call continuations. 519 * Clean up the pending request, and call continuations.
520 * 520 *
521 * @param cls closure 521 * @param cls closure
522 * @param ok #GNUNET_OK on success, #GNUNET_SYSERR on error
523 */ 522 */
524static void 523static void
525send_finished (void *cls, 524send_finished (void *cls)
526 int ok)
527{ 525{
528 struct PendingRequest *pr = cls; 526 struct PendingRequest *pr = cls;
529 struct GNUNET_ATS_Session *session = pr->session; 527 struct GNUNET_ATS_Session *session = pr->session;
@@ -535,7 +533,7 @@ send_finished (void *cls,
535 if (NULL != pr->transmit_cont) 533 if (NULL != pr->transmit_cont)
536 pr->transmit_cont (pr->transmit_cont_cls, 534 pr->transmit_cont (pr->transmit_cont_cls,
537 &session->sender, 535 &session->sender,
538 ok, 536 GNUNET_OK,
539 pr->size, 0); 537 pr->size, 0);
540 GNUNET_free (pr); 538 GNUNET_free (pr);
541} 539}
diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h
index 248e373dc..f58311f74 100644
--- a/src/include/gnunet_dv_service.h
+++ b/src/include/gnunet_dv_service.h
@@ -45,10 +45,11 @@
45 * @param distance distance to the peer 45 * @param distance distance to the peer
46 * @param network the peer is located in 46 * @param network the peer is located in
47 */ 47 */
48typedef void (*GNUNET_DV_ConnectCallback)(void *cls, 48typedef void
49 const struct GNUNET_PeerIdentity *peer, 49(*GNUNET_DV_ConnectCallback)(void *cls,
50 uint32_t distance, 50 const struct GNUNET_PeerIdentity *peer,
51 enum GNUNET_ATS_Network_Type network); 51 uint32_t distance,
52 enum GNUNET_ATS_Network_Type network);
52 53
53 54
54/** 55/**
@@ -60,10 +61,11 @@ typedef void (*GNUNET_DV_ConnectCallback)(void *cls,
60 * @param distance new distance to the peer 61 * @param distance new distance to the peer
61 * @param network this network will be used to reach the next hop 62 * @param network this network will be used to reach the next hop
62 */ 63 */
63typedef void (*GNUNET_DV_DistanceChangedCallback)(void *cls, 64typedef void
64 const struct GNUNET_PeerIdentity *peer, 65(*GNUNET_DV_DistanceChangedCallback)(void *cls,
65 uint32_t distance, 66 const struct GNUNET_PeerIdentity *peer,
66 enum GNUNET_ATS_Network_Type network); 67 uint32_t distance,
68 enum GNUNET_ATS_Network_Type network);
67 69
68 70
69/** 71/**
@@ -73,8 +75,9 @@ typedef void (*GNUNET_DV_DistanceChangedCallback)(void *cls,
73 * @param cls closure 75 * @param cls closure
74 * @param peer peer that disconnected 76 * @param peer peer that disconnected
75 */ 77 */
76typedef void (*GNUNET_DV_DisconnectCallback)(void *cls, 78typedef void
77 const struct GNUNET_PeerIdentity *peer); 79(*GNUNET_DV_DisconnectCallback)(void *cls,
80 const struct GNUNET_PeerIdentity *peer);
78 81
79 82
80/** 83/**
@@ -86,10 +89,11 @@ typedef void (*GNUNET_DV_DisconnectCallback)(void *cls,
86 * @param distance how far did the message travel 89 * @param distance how far did the message travel
87 * @param msg actual message payload 90 * @param msg actual message payload
88 */ 91 */
89typedef void (*GNUNET_DV_MessageReceivedCallback)(void *cls, 92typedef void
90 const struct GNUNET_PeerIdentity *sender, 93(*GNUNET_DV_MessageReceivedCallback)(void *cls,
91 uint32_t distance, 94 const struct GNUNET_PeerIdentity *sender,
92 const struct GNUNET_MessageHeader *msg); 95 uint32_t distance,
96 const struct GNUNET_MessageHeader *msg);
93 97
94 98
95/** 99/**
@@ -97,10 +101,9 @@ typedef void (*GNUNET_DV_MessageReceivedCallback)(void *cls,
97 * message has been successful. 101 * message has been successful.
98 * 102 *
99 * @param cls closure 103 * @param cls closure
100 * @param ok GNUNET_OK on success, GNUNET_SYSERR on error
101 */ 104 */
102typedef void (*GNUNET_DV_MessageSentCallback)(void *cls, 105typedef void
103 int ok); 106(*GNUNET_DV_MessageSentCallback)(void *cls);
104 107
105 108
106/** 109/**