diff options
author | t3sserakt <t3ss@posteo.de> | 2024-01-10 11:33:40 +0100 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2024-01-10 11:33:40 +0100 |
commit | 84b76e31d77e88c36b40d334c9990c7029b00d35 (patch) | |
tree | c68052e2abc0c4e9879589278c4a556f3b837b70 | |
parent | b9cd040cbe471672984a607ddbbf91752d1a62a2 (diff) | |
download | gnunet-84b76e31d77e88c36b40d334c9990c7029b00d35.tar.gz gnunet-84b76e31d77e88c36b40d334c9990c7029b00d35.zip |
Resuming communicators in case of core restarting.
-rw-r--r-- | src/service/transport/gnunet-service-transport.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c index 1522a5f21..ab64ddf32 100644 --- a/src/service/transport/gnunet-service-transport.c +++ b/src/service/transport/gnunet-service-transport.c | |||
@@ -4102,6 +4102,34 @@ notify_client_connect_info (void *cls, | |||
4102 | 4102 | ||
4103 | 4103 | ||
4104 | /** | 4104 | /** |
4105 | * Send ACK to communicator (if requested) and free @a cmc. | ||
4106 | * | ||
4107 | * @param cmc context for which we are done handling the message | ||
4108 | */ | ||
4109 | static void | ||
4110 | finish_cmc_handling_with_continue (struct CommunicatorMessageContext *cmc, | ||
4111 | unsigned | ||
4112 | int continue_client); | ||
4113 | |||
4114 | static enum GNUNET_GenericReturnValue | ||
4115 | resume_communicators(void *cls, | ||
4116 | const struct GNUNET_PeerIdentity *pid, | ||
4117 | void *value) | ||
4118 | { | ||
4119 | struct VirtualLink *vl = value; | ||
4120 | struct CommunicatorMessageContext *cmc; | ||
4121 | |||
4122 | /* resume communicators */ | ||
4123 | while (NULL != (cmc = vl->cmc_tail)) | ||
4124 | { | ||
4125 | GNUNET_CONTAINER_DLL_remove (vl->cmc_head, vl->cmc_tail, cmc); | ||
4126 | finish_cmc_handling_with_continue (cmc, GNUNET_YES == cmc->continue_send ? GNUNET_NO : GNUNET_YES); | ||
4127 | } | ||
4128 | return GNUNET_OK; | ||
4129 | } | ||
4130 | |||
4131 | |||
4132 | /** | ||
4105 | * Initialize a "CORE" client. We got a start message from this | 4133 | * Initialize a "CORE" client. We got a start message from this |
4106 | * client, so add it to the list of clients for broadcasting of | 4134 | * client, so add it to the list of clients for broadcasting of |
4107 | * inbound messages. | 4135 | * inbound messages. |
@@ -4137,6 +4165,9 @@ handle_client_start (void *cls, const struct StartMessage *start) | |||
4137 | GNUNET_CONTAINER_multipeermap_iterate (neighbours, | 4165 | GNUNET_CONTAINER_multipeermap_iterate (neighbours, |
4138 | ¬ify_client_connect_info, | 4166 | ¬ify_client_connect_info, |
4139 | tc); | 4167 | tc); |
4168 | GNUNET_CONTAINER_multipeermap_iterate (links, | ||
4169 | &resume_communicators, | ||
4170 | NULL); | ||
4140 | GNUNET_SERVICE_client_continue (tc->client); | 4171 | GNUNET_SERVICE_client_continue (tc->client); |
4141 | } | 4172 | } |
4142 | 4173 | ||