summaryrefslogtreecommitdiff
path: root/src/analysis/db/client.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-06-03 23:12:24 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-06-03 23:12:24 (GMT)
commitdac827b81a8e29cb83fb17985ad5e83770cd833f (patch)
tree08bf412e74bb39d33ccf5f0b473f38aae0581eed /src/analysis/db/client.c
parent9eab0a0903303d3c93872e7e4b6b1cb774b69b03 (diff)
Reconnect the analysis clients to servers when requested.
Diffstat (limited to 'src/analysis/db/client.c')
-rw-r--r--src/analysis/db/client.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/analysis/db/client.c b/src/analysis/db/client.c
index aa1407c..6ce33b0 100644
--- a/src/analysis/db/client.c
+++ b/src/analysis/db/client.c
@@ -99,6 +99,10 @@ static void g_hub_client_class_init(GHubClientClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_hub_client_dispose;
object->finalize = (GObjectFinalizeFunc)g_hub_client_finalize;
+ klass->role = CRL_UNDEFINED;
+ klass->complete_hello = NULL;
+ klass->recv_func = NULL;
+
}
@@ -485,7 +489,8 @@ static bool g_hub_client_start_common(GHubClient *client, char *desc)
* On réalise l'envoi initial ; le premier paquet doit contenir :
* - la commande 'DBC_HELO' ;
* - le numéro de version du client ;
- * - le rôle attendu de la connexion.
+ * - le rôle attendu de la connexion ;
+ * - des données complémentaires éventuelles.
*
* Tout ceci est à synchroniser avec la fonction g_db_server_listener().
*/
@@ -501,9 +506,11 @@ static bool g_hub_client_start_common(GHubClient *client, char *desc)
status = extend_packed_buffer(&out_pbuf, &class->role, sizeof(uint32_t), true);
if (!status) goto setup_error;
-
-
-
+ if (class->complete_hello != NULL)
+ {
+ status = class->complete_hello(client, &out_pbuf);
+ if (!status) goto setup_error;
+ }
status = ssl_send_packed_buffer(&out_pbuf, client->tls_fd);
if (!status) goto setup_error;