diff options
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index b5f9e0a6b..6fc538f25 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -401,11 +401,9 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h); | |||
401 | * A neighbour has not gotten a SEND_OK in a while. Print a warning. | 401 | * A neighbour has not gotten a SEND_OK in a while. Print a warning. |
402 | * | 402 | * |
403 | * @param cls the `struct Neighbour` | 403 | * @param cls the `struct Neighbour` |
404 | * @param tc scheduler context | ||
405 | */ | 404 | */ |
406 | static void | 405 | static void |
407 | do_warn_unready (void *cls, | 406 | do_warn_unready (void *cls) |
408 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
409 | { | 407 | { |
410 | struct Neighbour *n = cls; | 408 | struct Neighbour *n = cls; |
411 | struct GNUNET_TIME_Relative delay; | 409 | struct GNUNET_TIME_Relative delay; |
@@ -830,11 +828,9 @@ demultiplexer (void *cls, | |||
830 | * network congestion. Notify the initiator and clean up. | 828 | * network congestion. Notify the initiator and clean up. |
831 | * | 829 | * |
832 | * @param cls the `struct GNUNET_TRANSPORT_TransmitHandle` | 830 | * @param cls the `struct GNUNET_TRANSPORT_TransmitHandle` |
833 | * @param tc scheduler context | ||
834 | */ | 831 | */ |
835 | static void | 832 | static void |
836 | timeout_request_due_to_congestion (void *cls, | 833 | timeout_request_due_to_congestion (void *cls) |
837 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
838 | { | 834 | { |
839 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; | 835 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; |
840 | struct Neighbour *n = th->neighbour; | 836 | struct Neighbour *n = th->neighbour; |
@@ -1015,11 +1011,9 @@ transport_notify_ready (void *cls, | |||
1015 | * list or the peer message queues to the service. | 1011 | * list or the peer message queues to the service. |
1016 | * | 1012 | * |
1017 | * @param cls transport service to schedule a transmission for | 1013 | * @param cls transport service to schedule a transmission for |
1018 | * @param tc scheduler context | ||
1019 | */ | 1014 | */ |
1020 | static void | 1015 | static void |
1021 | schedule_transmission_task (void *cls, | 1016 | schedule_transmission_task (void *cls) |
1022 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1023 | { | 1017 | { |
1024 | struct GNUNET_TRANSPORT_Handle *h = cls; | 1018 | struct GNUNET_TRANSPORT_Handle *h = cls; |
1025 | size_t size; | 1019 | size_t size; |
@@ -1197,15 +1191,15 @@ send_start (void *cls, | |||
1197 | * Try again to connect to transport service. | 1191 | * Try again to connect to transport service. |
1198 | * | 1192 | * |
1199 | * @param cls the handle to the transport service | 1193 | * @param cls the handle to the transport service |
1200 | * @param tc scheduler context | ||
1201 | */ | 1194 | */ |
1202 | static void | 1195 | static void |
1203 | reconnect (void *cls, | 1196 | reconnect (void *cls) |
1204 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1205 | { | 1197 | { |
1206 | struct GNUNET_TRANSPORT_Handle *h = cls; | 1198 | struct GNUNET_TRANSPORT_Handle *h = cls; |
1199 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1207 | 1200 | ||
1208 | h->reconnect_task = NULL; | 1201 | h->reconnect_task = NULL; |
1202 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1209 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1203 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1210 | { | 1204 | { |
1211 | /* shutdown, just give up */ | 1205 | /* shutdown, just give up */ |
@@ -1315,19 +1309,14 @@ send_hello (void *cls, | |||
1315 | struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls; | 1309 | struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls; |
1316 | struct GNUNET_MessageHeader *msg = ohh->msg; | 1310 | struct GNUNET_MessageHeader *msg = ohh->msg; |
1317 | uint16_t ssize; | 1311 | uint16_t ssize; |
1318 | struct GNUNET_SCHEDULER_TaskContext tc; | ||
1319 | 1312 | ||
1320 | tc.read_ready = NULL; | ||
1321 | tc.write_ready = NULL; | ||
1322 | tc.reason = GNUNET_SCHEDULER_REASON_TIMEOUT; | ||
1323 | if (NULL == buf) | 1313 | if (NULL == buf) |
1324 | { | 1314 | { |
1325 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1315 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1326 | "Timeout while trying to transmit `%s' request.\n", | 1316 | "Timeout while trying to transmit `%s' request.\n", |
1327 | "HELLO"); | 1317 | "HELLO"); |
1328 | if (NULL != ohh->cont) | 1318 | if (NULL != ohh->cont) |
1329 | ohh->cont (ohh->cls, | 1319 | ohh->cont (ohh->cls); |
1330 | &tc); | ||
1331 | GNUNET_free (msg); | 1320 | GNUNET_free (msg); |
1332 | GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, | 1321 | GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, |
1333 | ohh->th->oh_tail, | 1322 | ohh->th->oh_tail, |
@@ -1344,10 +1333,8 @@ send_hello (void *cls, | |||
1344 | msg, | 1333 | msg, |
1345 | ssize); | 1334 | ssize); |
1346 | GNUNET_free (msg); | 1335 | GNUNET_free (msg); |
1347 | tc.reason = GNUNET_SCHEDULER_REASON_READ_READY; | ||
1348 | if (NULL != ohh->cont) | 1336 | if (NULL != ohh->cont) |
1349 | ohh->cont (ohh->cls, | 1337 | ohh->cont (ohh->cls); |
1350 | &tc); | ||
1351 | GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, | 1338 | GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, |
1352 | ohh->th->oh_tail, | 1339 | ohh->th->oh_tail, |
1353 | ohh); | 1340 | ohh); |
@@ -1529,11 +1516,9 @@ GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle, | |||
1529 | * Task to call the HelloUpdateCallback of the GetHelloHandle | 1516 | * Task to call the HelloUpdateCallback of the GetHelloHandle |
1530 | * | 1517 | * |
1531 | * @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle` | 1518 | * @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle` |
1532 | * @param tc the scheduler task context | ||
1533 | */ | 1519 | */ |
1534 | static void | 1520 | static void |
1535 | call_hello_update_cb_async (void *cls, | 1521 | call_hello_update_cb_async (void *cls) |
1536 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1537 | { | 1522 | { |
1538 | struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls; | 1523 | struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls; |
1539 | 1524 | ||