diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-06-25 23:37:13 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-06-25 23:37:13 +0000 |
commit | 4340fe90fc88c79a1f90b52ced9acfef6719b8be (patch) | |
tree | f7c3af808fed7bd672c8de2c644b6199aa688b0e | |
parent | 298adbb1d8ac5355e925c69fae5706518c18d8e9 (diff) | |
download | gnunet-4340fe90fc88c79a1f90b52ced9acfef6719b8be.tar.gz gnunet-4340fe90fc88c79a1f90b52ced9acfef6719b8be.zip |
doxygen
-rw-r--r-- | doc/testbed_test.c | 4 | ||||
-rw-r--r-- | src/consensus/consensus_api.c | 2 | ||||
-rw-r--r-- | src/consensus/gnunet-service-consensus.c | 2 | ||||
-rw-r--r-- | src/include/gnunet_mq_lib.h | 29 | ||||
-rw-r--r-- | src/include/gnunet_set_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_stream_lib.h | 1 | ||||
-rw-r--r-- | src/set/gnunet-service-set.c | 5 | ||||
-rw-r--r-- | src/set/gnunet-service-set.h | 4 | ||||
-rw-r--r-- | src/set/gnunet-service-set_intersection.c | 2 | ||||
-rw-r--r-- | src/set/gnunet-service-set_union.c | 5 | ||||
-rw-r--r-- | src/set/gnunet-set-profiler.c | 3 | ||||
-rw-r--r-- | src/set/set_api.c | 6 | ||||
-rw-r--r-- | src/stream/stream_api.c | 1 | ||||
-rw-r--r-- | src/util/mq.c | 32 |
14 files changed, 69 insertions, 31 deletions
diff --git a/doc/testbed_test.c b/doc/testbed_test.c index b1102ef92..c34d064b0 100644 --- a/doc/testbed_test.c +++ b/doc/testbed_test.c | |||
@@ -111,6 +111,7 @@ dht_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
111 | * Dual of 'dht_ca' to perform the 'disconnect'/cleanup operation | 111 | * Dual of 'dht_ca' to perform the 'disconnect'/cleanup operation |
112 | * once we no longer need to access this subsystem. | 112 | * once we no longer need to access this subsystem. |
113 | * | 113 | * |
114 | * @param cls closure | ||
114 | * @param op_result whatever we returned from 'dht_ca' | 115 | * @param op_result whatever we returned from 'dht_ca' |
115 | */ | 116 | */ |
116 | static void | 117 | static void |
@@ -130,6 +131,7 @@ dht_da (void *cls, void *op_result) | |||
130 | * just to the DHT service of peer 0. | 131 | * just to the DHT service of peer 0. |
131 | * | 132 | * |
132 | * @param cls closure | 133 | * @param cls closure |
134 | * @param peers started peers for the test | ||
133 | * @param num_peers size of the 'peers' array | 135 | * @param num_peers size of the 'peers' array |
134 | * @param links_succeeded number of links between peers that were created | 136 | * @param links_succeeded number of links between peers that were created |
135 | * @param links_failed number of links testbed was unable to establish | 137 | * @param links_failed number of links testbed was unable to establish |
@@ -137,7 +139,7 @@ dht_da (void *cls, void *op_result) | |||
137 | static void | 139 | static void |
138 | test_master (void *cls, unsigned int num_peers, | 140 | test_master (void *cls, unsigned int num_peers, |
139 | struct GNUNET_TESTBED_Peer **peers, | 141 | struct GNUNET_TESTBED_Peer **peers, |
140 | unsigned int links_succeeeded, | 142 | unsigned int links_succeeded, |
141 | unsigned int links_failed) | 143 | unsigned int links_failed) |
142 | { | 144 | { |
143 | /* Testbed is ready with peers running and connected in a pre-defined overlay | 145 | /* Testbed is ready with peers running and connected in a pre-defined overlay |
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c index 684580755..a1dc40826 100644 --- a/src/consensus/consensus_api.c +++ b/src/consensus/consensus_api.c | |||
@@ -141,7 +141,7 @@ handle_new_element (void *cls, | |||
141 | * that the conclusion is over. | 141 | * that the conclusion is over. |
142 | * | 142 | * |
143 | * @param cls consensus handle | 143 | * @param cls consensus handle |
144 | * @param mh conclude done message | 144 | * @param msg conclude done message |
145 | */ | 145 | */ |
146 | static void | 146 | static void |
147 | handle_conclude_done (void *cls, | 147 | handle_conclude_done (void *cls, |
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index 1c2c78422..9cde0e46b 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c | |||
@@ -702,6 +702,7 @@ initialize_session_peer_list (struct ConsensusSession *session, | |||
702 | * Called when another peer wants to do a set operation with the | 702 | * Called when another peer wants to do a set operation with the |
703 | * local peer. | 703 | * local peer. |
704 | * | 704 | * |
705 | * @param cls closure | ||
705 | * @param other_peer the other peer | 706 | * @param other_peer the other peer |
706 | * @param context_msg message with application specific information from | 707 | * @param context_msg message with application specific information from |
707 | * the other peer | 708 | * the other peer |
@@ -786,6 +787,7 @@ set_listen_cb (void *cls, | |||
786 | * Initialize the session, continue receiving messages from the owning client | 787 | * Initialize the session, continue receiving messages from the owning client |
787 | * | 788 | * |
788 | * @param session the session to initialize | 789 | * @param session the session to initialize |
790 | * @param join_msg the join message from the client | ||
789 | */ | 791 | */ |
790 | static void | 792 | static void |
791 | initialize_session (struct ConsensusSession *session, | 793 | initialize_session (struct ConsensusSession *session, |
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 3a4dd3d5f..048ad39a0 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Florian Dold | 22 | * @author Florian Dold |
23 | * @file set/mq.h | 23 | * @file include/gnunet_mq_lib.h |
24 | * @brief general purpose message queue | 24 | * @brief general purpose message queue |
25 | */ | 25 | */ |
26 | #ifndef GNUNET_MQ_H | 26 | #ifndef GNUNET_MQ_H |
@@ -114,6 +114,9 @@ GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh, uint16_t ba | |||
114 | * | 114 | * |
115 | * @param mhp pointer to the message header pointer that will be changed to allocate at | 115 | * @param mhp pointer to the message header pointer that will be changed to allocate at |
116 | * the newly allocated space for the message. | 116 | * the newly allocated space for the message. |
117 | * @param base_size size of the data before the nested message | ||
118 | * @param type type of the message in the envelope | ||
119 | * @param nested_mh the message to append to the message after base_size | ||
117 | */ | 120 | */ |
118 | struct GNUNET_MQ_Envelope * | 121 | struct GNUNET_MQ_Envelope * |
119 | GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, uint16_t base_size, uint16_t type, | 122 | GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, uint16_t base_size, uint16_t type, |
@@ -271,7 +274,7 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm); | |||
271 | * May only be called once per message. | 274 | * May only be called once per message. |
272 | * | 275 | * |
273 | * @param mq message queue | 276 | * @param mq message queue |
274 | * @param mqm the message to send. | 277 | * @param ev the envelope with the message to send. |
275 | */ | 278 | */ |
276 | void | 279 | void |
277 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); | 280 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); |
@@ -281,7 +284,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); | |||
281 | * Cancel sending the message. Message must have been sent with GNUNET_MQ_send before. | 284 | * Cancel sending the message. Message must have been sent with GNUNET_MQ_send before. |
282 | * May not be called after the notify sent callback has been called | 285 | * May not be called after the notify sent callback has been called |
283 | * | 286 | * |
284 | * @param mqm queued message to cancel | 287 | * @param ev queued envelope to cancel |
285 | */ | 288 | */ |
286 | void | 289 | void |
287 | GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev); | 290 | GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev); |
@@ -291,7 +294,6 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev); | |||
291 | * Associate the assoc_data in mq with a unique request id. | 294 | * Associate the assoc_data in mq with a unique request id. |
292 | * | 295 | * |
293 | * @param mq message queue, id will be unique for the queue | 296 | * @param mq message queue, id will be unique for the queue |
294 | * @param mqm message to associate | ||
295 | * @param assoc_data to associate | 297 | * @param assoc_data to associate |
296 | */ | 298 | */ |
297 | uint32_t | 299 | uint32_t |
@@ -350,11 +352,11 @@ GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client); | |||
350 | * | 352 | * |
351 | * @param send function the implements sending messages | 353 | * @param send function the implements sending messages |
352 | * @param destroy function that implements destroying the queue | 354 | * @param destroy function that implements destroying the queue |
353 | * @param destroy function that implements canceling a message | 355 | * @param cancel function that implements canceling a message |
354 | * @param state for the queue, passed to 'send' and 'destroy' | 356 | * @param impl_state for the queue, passed to 'send' and 'destroy' |
355 | * @param handlers array of message handlers | 357 | * @param handlers array of message handlers |
356 | * @param error_handler handler for read and write errors | 358 | * @param error_handler handler for read and write errors |
357 | * @param cls closure for handlers | 359 | * @param cls closure for message handlers and error handler |
358 | * @return a new message queue | 360 | * @return a new message queue |
359 | */ | 361 | */ |
360 | struct GNUNET_MQ_Handle * | 362 | struct GNUNET_MQ_Handle * |
@@ -411,7 +413,11 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq); | |||
411 | 413 | ||
412 | 414 | ||
413 | /** | 415 | /** |
414 | * Call the right callback for a message. | 416 | * Call the message message handler that was registered |
417 | * for the type of the given message in the given message queue. | ||
418 | * | ||
419 | * This function is indended to be used for the implementation | ||
420 | * of message queues. | ||
415 | * | 421 | * |
416 | * @param mq message queue with the handlers | 422 | * @param mq message queue with the handlers |
417 | * @param mh message to dispatch | 423 | * @param mh message to dispatch |
@@ -422,9 +428,14 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, | |||
422 | 428 | ||
423 | 429 | ||
424 | /** | 430 | /** |
425 | * Call the right callback for an error condition. | 431 | * Call the error handler of a message queue with the given |
432 | * error code. If there is no error handler, log a warning. | ||
433 | * | ||
434 | * This function is intended to be used for the implementation | ||
435 | * of message queues. | ||
426 | * | 436 | * |
427 | * @param mq message queue | 437 | * @param mq message queue |
438 | * @param error the error type | ||
428 | */ | 439 | */ |
429 | void | 440 | void |
430 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, | 441 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, |
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index e08ed5d69..2da53cac9 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h | |||
@@ -156,7 +156,7 @@ struct GNUNET_SET_Element | |||
156 | /** | 156 | /** |
157 | * Continuation used for some of the set operations | 157 | * Continuation used for some of the set operations |
158 | * | 158 | * |
159 | * @cls closure | 159 | * @param cls closure |
160 | */ | 160 | */ |
161 | typedef void (*GNUNET_SET_Continuation) (void *cls); | 161 | typedef void (*GNUNET_SET_Continuation) (void *cls); |
162 | 162 | ||
@@ -330,7 +330,7 @@ struct GNUNET_SET_OperationHandle * | |||
330 | GNUNET_SET_accept (struct GNUNET_SET_Request *request, | 330 | GNUNET_SET_accept (struct GNUNET_SET_Request *request, |
331 | enum GNUNET_SET_ResultMode result_mode, | 331 | enum GNUNET_SET_ResultMode result_mode, |
332 | GNUNET_SET_ResultIterator result_cb, | 332 | GNUNET_SET_ResultIterator result_cb, |
333 | void *cls); | 333 | void *result_cls); |
334 | 334 | ||
335 | 335 | ||
336 | /** | 336 | /** |
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h index 65e247ece..f89815c57 100644 --- a/src/include/gnunet_stream_lib.h +++ b/src/include/gnunet_stream_lib.h | |||
@@ -401,6 +401,7 @@ GNUNET_STREAM_read_cancel (struct GNUNET_STREAM_ReadHandle *rh); | |||
401 | * @param socket the socket to read/write in the message queue | 401 | * @param socket the socket to read/write in the message queue |
402 | * @param msg_handlers message handler array | 402 | * @param msg_handlers message handler array |
403 | * @param error_handler callback for errors | 403 | * @param error_handler callback for errors |
404 | * @param cls closure for message handlers and error handler | ||
404 | * @return the message queue for the socket | 405 | * @return the message queue for the socket |
405 | */ | 406 | */ |
406 | struct GNUNET_MQ_Handle * | 407 | struct GNUNET_MQ_Handle * |
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c index 644626dd0..bab29b097 100644 --- a/src/set/gnunet-service-set.c +++ b/src/set/gnunet-service-set.c | |||
@@ -251,6 +251,8 @@ tunnel_context_destroy (struct TunnelContext *tc) | |||
251 | * another peer. | 251 | * another peer. |
252 | * | 252 | * |
253 | * @param cls the incoming socket | 253 | * @param cls the incoming socket |
254 | * @param tunnel the tunnel that sent the message | ||
255 | * @param tunnel_ctx the tunnel context | ||
254 | * @param mh the message | 256 | * @param mh the message |
255 | */ | 257 | */ |
256 | static int | 258 | static int |
@@ -524,7 +526,6 @@ handle_client_evaluate (void *cls, | |||
524 | return; | 526 | return; |
525 | } | 527 | } |
526 | 528 | ||
527 | |||
528 | switch (set->operation) | 529 | switch (set->operation) |
529 | { | 530 | { |
530 | case GNUNET_SET_OPERATION_INTERSECTION: | 531 | case GNUNET_SET_OPERATION_INTERSECTION: |
@@ -694,6 +695,8 @@ tunnel_new_cb (void *cls, | |||
694 | struct Incoming *incoming; | 695 | struct Incoming *incoming; |
695 | struct TunnelContext *tc; | 696 | struct TunnelContext *tc; |
696 | 697 | ||
698 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "new incoming tunnel\n"); | ||
699 | |||
697 | GNUNET_assert (port == GNUNET_APPLICATION_TYPE_SET); | 700 | GNUNET_assert (port == GNUNET_APPLICATION_TYPE_SET); |
698 | tc = GNUNET_new (struct TunnelContext); | 701 | tc = GNUNET_new (struct TunnelContext); |
699 | incoming = GNUNET_new (struct Incoming); | 702 | incoming = GNUNET_new (struct Incoming); |
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h index 937bc9adc..d60b5f477 100644 --- a/src/set/gnunet-service-set.h +++ b/src/set/gnunet-service-set.h | |||
@@ -257,7 +257,7 @@ _GSS_union_set_create (void); | |||
257 | * a remote peer. | 257 | * a remote peer. |
258 | * | 258 | * |
259 | * @param m the evaluate request message from the client | 259 | * @param m the evaluate request message from the client |
260 | * @parem set the set to evaluate the operation with | 260 | * @param set the set to evaluate the operation with |
261 | */ | 261 | */ |
262 | void | 262 | void |
263 | _GSS_union_evaluate (struct GNUNET_SET_EvaluateMessage *m, struct Set *set); | 263 | _GSS_union_evaluate (struct GNUNET_SET_EvaluateMessage *m, struct Set *set); |
@@ -287,7 +287,7 @@ _GSS_union_remove (struct GNUNET_SET_ElementMessage *m, struct Set *set); | |||
287 | /** | 287 | /** |
288 | * Destroy a set that supports the union operation | 288 | * Destroy a set that supports the union operation |
289 | * | 289 | * |
290 | * @param the set to destroy, must be of type GNUNET_SET_OPERATION_UNION | 290 | * @param set the set to destroy, must be of type GNUNET_SET_OPERATION_UNION |
291 | */ | 291 | */ |
292 | void | 292 | void |
293 | _GSS_union_set_destroy (struct Set *set); | 293 | _GSS_union_set_destroy (struct Set *set); |
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c index 411959329..fe3ba56ea 100644 --- a/src/set/gnunet-service-set_intersection.c +++ b/src/set/gnunet-service-set_intersection.c | |||
@@ -1287,7 +1287,7 @@ _GSS_intersection_add (struct GNUNET_SET_ElementMessage *m, struct Set *set) | |||
1287 | /** | 1287 | /** |
1288 | * Destroy a set that supports the union operation | 1288 | * Destroy a set that supports the union operation |
1289 | * | 1289 | * |
1290 | * @param the set to destroy, must be of type GNUNET_SET_OPERATION_UNION | 1290 | * @param set the set to destroy, must be of type GNUNET_SET_OPERATION_UNION |
1291 | */ | 1291 | */ |
1292 | void | 1292 | void |
1293 | _GSS_union_set_destroy (struct Set *set) | 1293 | _GSS_union_set_destroy (struct Set *set) |
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 294fa3304..670626cd4 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -493,7 +493,8 @@ send_operation_request (struct UnionEvaluateOperation *eo) | |||
493 | struct GNUNET_MQ_Envelope *mqm; | 493 | struct GNUNET_MQ_Envelope *mqm; |
494 | struct OperationRequestMessage *msg; | 494 | struct OperationRequestMessage *msg; |
495 | 495 | ||
496 | mqm = GNUNET_MQ_msg_nested_mh (msg, GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, eo->context_msg); | 496 | mqm = GNUNET_MQ_msg_nested_mh (msg, GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, |
497 | eo->context_msg); | ||
497 | 498 | ||
498 | if (NULL == mqm) | 499 | if (NULL == mqm) |
499 | { | 500 | { |
@@ -1287,7 +1288,7 @@ _GSS_union_add (struct GNUNET_SET_ElementMessage *m, struct Set *set) | |||
1287 | /** | 1288 | /** |
1288 | * Destroy a set that supports the union operation | 1289 | * Destroy a set that supports the union operation |
1289 | * | 1290 | * |
1290 | * @param the set to destroy, must be of type GNUNET_SET_OPERATION_UNION | 1291 | * @param set the set to destroy, must be of type GNUNET_SET_OPERATION_UNION |
1291 | */ | 1292 | */ |
1292 | void | 1293 | void |
1293 | _GSS_union_set_destroy (struct Set *set) | 1294 | _GSS_union_set_destroy (struct Set *set) |
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c index 0a2c2779b..814c9e436 100644 --- a/src/set/gnunet-set-profiler.c +++ b/src/set/gnunet-set-profiler.c | |||
@@ -38,7 +38,7 @@ static unsigned int num_c = 20; | |||
38 | 38 | ||
39 | static unsigned int salt = 42; | 39 | static unsigned int salt = 42; |
40 | 40 | ||
41 | static char* op_str = "union"; | 41 | static char *op_str = "union"; |
42 | 42 | ||
43 | const static struct GNUNET_CONFIGURATION_Handle *config; | 43 | const static struct GNUNET_CONFIGURATION_Handle *config; |
44 | 44 | ||
@@ -157,6 +157,7 @@ set_listen_cb (void *cls, | |||
157 | struct GNUNET_SET_Request *request) | 157 | struct GNUNET_SET_Request *request) |
158 | { | 158 | { |
159 | GNUNET_assert (NULL == set_oh2); | 159 | GNUNET_assert (NULL == set_oh2); |
160 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "set listen cb called\n"); | ||
160 | set_oh2 = GNUNET_SET_accept (request, GNUNET_SET_RESULT_ADDED, | 161 | set_oh2 = GNUNET_SET_accept (request, GNUNET_SET_RESULT_ADDED, |
161 | set_result_cb_2, NULL); | 162 | set_result_cb_2, NULL); |
162 | GNUNET_SET_commit (set_oh2, set_b); | 163 | GNUNET_SET_commit (set_oh2, set_b); |
diff --git a/src/set/set_api.c b/src/set/set_api.c index e1b6132cb..370846bae 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c | |||
@@ -400,14 +400,14 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh) | |||
400 | * @param result_mode specified how results will be returned, | 400 | * @param result_mode specified how results will be returned, |
401 | * see 'GNUNET_SET_ResultMode'. | 401 | * see 'GNUNET_SET_ResultMode'. |
402 | * @param result_cb callback for the results | 402 | * @param result_cb callback for the results |
403 | * @param cls closure for result_cb | 403 | * @param result_cls closure for result_cb |
404 | * @return a handle to cancel the operation | 404 | * @return a handle to cancel the operation |
405 | */ | 405 | */ |
406 | struct GNUNET_SET_OperationHandle * | 406 | struct GNUNET_SET_OperationHandle * |
407 | GNUNET_SET_accept (struct GNUNET_SET_Request *request, | 407 | GNUNET_SET_accept (struct GNUNET_SET_Request *request, |
408 | enum GNUNET_SET_ResultMode result_mode, | 408 | enum GNUNET_SET_ResultMode result_mode, |
409 | GNUNET_SET_ResultIterator result_cb, | 409 | GNUNET_SET_ResultIterator result_cb, |
410 | void *cls) | 410 | void *result_cls) |
411 | { | 411 | { |
412 | struct GNUNET_MQ_Envelope *mqm; | 412 | struct GNUNET_MQ_Envelope *mqm; |
413 | struct GNUNET_SET_OperationHandle *oh; | 413 | struct GNUNET_SET_OperationHandle *oh; |
@@ -418,7 +418,7 @@ GNUNET_SET_accept (struct GNUNET_SET_Request *request, | |||
418 | 418 | ||
419 | oh = GNUNET_new (struct GNUNET_SET_OperationHandle); | 419 | oh = GNUNET_new (struct GNUNET_SET_OperationHandle); |
420 | oh->result_cb = result_cb; | 420 | oh->result_cb = result_cb; |
421 | oh->result_cls = cls; | 421 | oh->result_cls = result_cls; |
422 | 422 | ||
423 | mqm = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_ACCEPT); | 423 | mqm = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_ACCEPT); |
424 | msg->accept_reject_id = htonl (request->accept_id); | 424 | msg->accept_reject_id = htonl (request->accept_id); |
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c index 47ed04117..b221d3a1d 100644 --- a/src/stream/stream_api.c +++ b/src/stream/stream_api.c | |||
@@ -3934,6 +3934,7 @@ mq_stream_destroy_impl (struct GNUNET_MQ_Handle *mq, void *impl_state) | |||
3934 | * @param socket the socket to read/write in the message queue | 3934 | * @param socket the socket to read/write in the message queue |
3935 | * @param msg_handlers message handler array | 3935 | * @param msg_handlers message handler array |
3936 | * @param error_handler callback for errors | 3936 | * @param error_handler callback for errors |
3937 | * @param cls closure for message handlers and error handler | ||
3937 | * @return the message queue for the socket | 3938 | * @return the message queue for the socket |
3938 | */ | 3939 | */ |
3939 | struct GNUNET_MQ_Handle * | 3940 | struct GNUNET_MQ_Handle * |
diff --git a/src/util/mq.c b/src/util/mq.c index 54d3d4a2e..f318dd04a 100644 --- a/src/util/mq.c +++ b/src/util/mq.c | |||
@@ -167,10 +167,12 @@ struct ClientConnectionState | |||
167 | }; | 167 | }; |
168 | 168 | ||
169 | 169 | ||
170 | |||
171 | |||
172 | /** | 170 | /** |
173 | * Call the right callback for a message. | 171 | * Call the message message handler that was registered |
172 | * for the type of the given message in the given message queue. | ||
173 | * | ||
174 | * This function is indended to be used for the implementation | ||
175 | * of message queues. | ||
174 | * | 176 | * |
175 | * @param mq message queue with the handlers | 177 | * @param mq message queue with the handlers |
176 | * @param mh message to dispatch | 178 | * @param mh message to dispatch |
@@ -199,9 +201,14 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, const struct GNUNET_Messa | |||
199 | 201 | ||
200 | 202 | ||
201 | /** | 203 | /** |
202 | * Call the right callback for an error condition. | 204 | * Call the error handler of a message queue with the given |
205 | * error code. If there is no error handler, log a warning. | ||
206 | * | ||
207 | * This function is intended to be used by the implementation | ||
208 | * of message queues. | ||
203 | * | 209 | * |
204 | * @param mq message queue | 210 | * @param mq message queue |
211 | * @param error the error type | ||
205 | */ | 212 | */ |
206 | void | 213 | void |
207 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, | 214 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, |
@@ -230,7 +237,7 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm) | |||
230 | * May only be called once per message. | 237 | * May only be called once per message. |
231 | * | 238 | * |
232 | * @param mq message queue | 239 | * @param mq message queue |
233 | * @param ev the message to send. | 240 | * @param ev the envelope with the message to send. |
234 | */ | 241 | */ |
235 | void | 242 | void |
236 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev) | 243 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev) |
@@ -288,10 +295,11 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq) | |||
288 | * | 295 | * |
289 | * @param send function the implements sending messages | 296 | * @param send function the implements sending messages |
290 | * @param destroy function that implements destroying the queue | 297 | * @param destroy function that implements destroying the queue |
291 | * @param destroy function that implements canceling a message | 298 | * @param cancel function that implements canceling a message |
292 | * @param state for the queue, passed to 'send' and 'destroy' | 299 | * @param impl_state for the queue, passed to 'send' and 'destroy' |
293 | * @param handlers array of message handlers | 300 | * @param handlers array of message handlers |
294 | * @param error_handler handler for read and write errors | 301 | * @param error_handler handler for read and write errors |
302 | * @param cls closure for message handlers and error handler | ||
295 | * @return a new message queue | 303 | * @return a new message queue |
296 | */ | 304 | */ |
297 | struct GNUNET_MQ_Handle * | 305 | struct GNUNET_MQ_Handle * |
@@ -391,6 +399,15 @@ GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, uint16_t size, uint16_t type) | |||
391 | } | 399 | } |
392 | 400 | ||
393 | 401 | ||
402 | /** | ||
403 | * Implementation of the GNUNET_MQ_msg_nested_mh macro. | ||
404 | * | ||
405 | * @param mhp pointer to the message header pointer that will be changed to allocate at | ||
406 | * the newly allocated space for the message. | ||
407 | * @param base_size size of the data before the nested message | ||
408 | * @param type type of the message in the envelope | ||
409 | * @param nested_mh the message to append to the message after base_size | ||
410 | */ | ||
394 | struct GNUNET_MQ_Envelope * | 411 | struct GNUNET_MQ_Envelope * |
395 | GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, uint16_t base_size, uint16_t type, | 412 | GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, uint16_t base_size, uint16_t type, |
396 | const struct GNUNET_MessageHeader *nested_mh) | 413 | const struct GNUNET_MessageHeader *nested_mh) |
@@ -633,7 +650,6 @@ GNUNET_MQ_replace_handlers (struct GNUNET_MQ_Handle *mq, | |||
633 | * Associate the assoc_data in mq with a unique request id. | 650 | * Associate the assoc_data in mq with a unique request id. |
634 | * | 651 | * |
635 | * @param mq message queue, id will be unique for the queue | 652 | * @param mq message queue, id will be unique for the queue |
636 | * @param mqm message to associate | ||
637 | * @param assoc_data to associate | 653 | * @param assoc_data to associate |
638 | */ | 654 | */ |
639 | uint32_t | 655 | uint32_t |