diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 186204f1e..d11368a79 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -1221,13 +1221,14 @@ connection_keepalive (struct CadetConnection *c, int fwd, int shutdown) | |||
1221 | * Keep the connection alive in the FWD direction. | 1221 | * Keep the connection alive in the FWD direction. |
1222 | * | 1222 | * |
1223 | * @param cls Closure (connection to keepalive). | 1223 | * @param cls Closure (connection to keepalive). |
1224 | * @param tc TaskContext. | ||
1225 | */ | 1224 | */ |
1226 | static void | 1225 | static void |
1227 | connection_fwd_keepalive (void *cls, | 1226 | connection_fwd_keepalive (void *cls) |
1228 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1229 | { | 1227 | { |
1228 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1229 | |||
1230 | GCC_check_connections (); | 1230 | GCC_check_connections (); |
1231 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1231 | connection_keepalive ((struct CadetConnection *) cls, | 1232 | connection_keepalive ((struct CadetConnection *) cls, |
1232 | GNUNET_YES, | 1233 | GNUNET_YES, |
1233 | tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN); | 1234 | tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN); |
@@ -1239,13 +1240,14 @@ connection_fwd_keepalive (void *cls, | |||
1239 | * Keep the connection alive in the BCK direction. | 1240 | * Keep the connection alive in the BCK direction. |
1240 | * | 1241 | * |
1241 | * @param cls Closure (connection to keepalive). | 1242 | * @param cls Closure (connection to keepalive). |
1242 | * @param tc TaskContext. | ||
1243 | */ | 1243 | */ |
1244 | static void | 1244 | static void |
1245 | connection_bck_keepalive (void *cls, | 1245 | connection_bck_keepalive (void *cls) |
1246 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1247 | { | 1246 | { |
1247 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1248 | |||
1248 | GCC_check_connections (); | 1249 | GCC_check_connections (); |
1250 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1249 | connection_keepalive ((struct CadetConnection *) cls, | 1251 | connection_keepalive ((struct CadetConnection *) cls, |
1250 | GNUNET_NO, | 1252 | GNUNET_NO, |
1251 | tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN); | 1253 | tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN); |
@@ -1400,11 +1402,9 @@ connection_cancel_queues (struct CadetConnection *c, | |||
1400 | * possibly due to a missed ACK. Poll the neighbor about its ACK status. | 1402 | * possibly due to a missed ACK. Poll the neighbor about its ACK status. |
1401 | * | 1403 | * |
1402 | * @param cls Closure (poll ctx). | 1404 | * @param cls Closure (poll ctx). |
1403 | * @param tc TaskContext. | ||
1404 | */ | 1405 | */ |
1405 | static void | 1406 | static void |
1406 | connection_poll (void *cls, | 1407 | connection_poll (void *cls); |
1407 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
1408 | 1408 | ||
1409 | 1409 | ||
1410 | /** | 1410 | /** |
@@ -1453,18 +1453,19 @@ poll_sent (void *cls, | |||
1453 | * possibly due to a missed ACK. Poll the neighbor about its ACK status. | 1453 | * possibly due to a missed ACK. Poll the neighbor about its ACK status. |
1454 | * | 1454 | * |
1455 | * @param cls Closure (poll ctx). | 1455 | * @param cls Closure (poll ctx). |
1456 | * @param tc TaskContext. | ||
1457 | */ | 1456 | */ |
1458 | static void | 1457 | static void |
1459 | connection_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1458 | connection_poll (void *cls) |
1460 | { | 1459 | { |
1461 | struct CadetFlowControl *fc = cls; | 1460 | struct CadetFlowControl *fc = cls; |
1462 | struct GNUNET_CADET_Poll msg; | 1461 | struct GNUNET_CADET_Poll msg; |
1463 | struct CadetConnection *c; | 1462 | struct CadetConnection *c; |
1464 | int fwd; | 1463 | int fwd; |
1464 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1465 | 1465 | ||
1466 | fc->poll_task = NULL; | 1466 | fc->poll_task = NULL; |
1467 | GCC_check_connections (); | 1467 | GCC_check_connections (); |
1468 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1468 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1469 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1469 | { | 1470 | { |
1470 | return; | 1471 | return; |
@@ -1586,15 +1587,15 @@ connection_timeout (struct CadetConnection *c, int fwd) | |||
1586 | * Destroys connection if called. | 1587 | * Destroys connection if called. |
1587 | * | 1588 | * |
1588 | * @param cls Closure (connection to destroy). | 1589 | * @param cls Closure (connection to destroy). |
1589 | * @param tc TaskContext. | ||
1590 | */ | 1590 | */ |
1591 | static void | 1591 | static void |
1592 | connection_fwd_timeout (void *cls, | 1592 | connection_fwd_timeout (void *cls) |
1593 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1594 | { | 1593 | { |
1595 | struct CadetConnection *c = cls; | 1594 | struct CadetConnection *c = cls; |
1595 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1596 | 1596 | ||
1597 | c->fwd_maintenance_task = NULL; | 1597 | c->fwd_maintenance_task = NULL; |
1598 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1598 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1599 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1599 | return; | 1600 | return; |
1600 | GCC_check_connections (); | 1601 | GCC_check_connections (); |
@@ -1608,15 +1609,15 @@ connection_fwd_timeout (void *cls, | |||
1608 | * Destroys connection if called. | 1609 | * Destroys connection if called. |
1609 | * | 1610 | * |
1610 | * @param cls Closure (connection to destroy). | 1611 | * @param cls Closure (connection to destroy). |
1611 | * @param tc TaskContext | ||
1612 | */ | 1612 | */ |
1613 | static void | 1613 | static void |
1614 | connection_bck_timeout (void *cls, | 1614 | connection_bck_timeout (void *cls) |
1615 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1616 | { | 1615 | { |
1617 | struct CadetConnection *c = cls; | 1616 | struct CadetConnection *c = cls; |
1617 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1618 | 1618 | ||
1619 | c->bck_maintenance_task = NULL; | 1619 | c->bck_maintenance_task = NULL; |
1620 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1620 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1621 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1621 | return; | 1622 | return; |
1622 | GCC_check_connections (); | 1623 | GCC_check_connections (); |
@@ -1761,14 +1762,15 @@ does_connection_exist (struct CadetConnection *conn) | |||
1761 | * connection with the same path, and destroy one if so. | 1762 | * connection with the same path, and destroy one if so. |
1762 | * | 1763 | * |
1763 | * @param cls Closure (connection to check). | 1764 | * @param cls Closure (connection to check). |
1764 | * @param tc Task context. | ||
1765 | */ | 1765 | */ |
1766 | static void | 1766 | static void |
1767 | check_duplicates (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1767 | check_duplicates (void *cls) |
1768 | { | 1768 | { |
1769 | struct CadetConnection *c = cls; | 1769 | struct CadetConnection *c = cls; |
1770 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1770 | 1771 | ||
1771 | c->check_duplicates_task = NULL; | 1772 | c->check_duplicates_task = NULL; |
1773 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1772 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1774 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1773 | return; | 1775 | return; |
1774 | 1776 | ||