summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analysis/db/cdb.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/analysis/db/cdb.c b/src/analysis/db/cdb.c
index 014a6d8..d56c1fa 100644
--- a/src/analysis/db/cdb.c
+++ b/src/analysis/db/cdb.c
@@ -972,10 +972,22 @@ DBError g_cdb_archive_add_client(GCdbArchive *archive, int fd, const rle_string
archive->clients[archive->count - 1].fd = fd;
dup_rle_string(&archive->clients[archive->count - 1].user, user);
+ /* Démarrage ou redémarrage du processus d'écoute */
+ if (archive->process == NULL)
+ {
+ archive->process = g_thread_new("cdb_process", (GThreadFunc)g_cdb_archive_process, archive);
- /* Envoi des mises à jour au nouveau client... */
+ /* On attend que le processus parallèle soit prêt */
+ for (process_id = &archive->process_id; *process_id == 0; );
+ }
+ else
+ pthread_kill(archive->process_id, SIGUSR1);
+
+ g_mutex_unlock(&archive->clients_access);
+
+ /* Envoi des mises à jour au nouveau client... */
for (iter = g_list_first(archive->collections);
iter != NULL;
@@ -994,22 +1006,6 @@ DBError g_cdb_archive_add_client(GCdbArchive *archive, int fd, const rle_string
- /* Démarrage ou redémarrage du processus d'écoute */
-
- if (archive->process == NULL)
- {
- archive->process = g_thread_new("cdb_process", (GThreadFunc)g_cdb_archive_process, archive);
-
- /* On attend que le processus parallèle soit prêt */
- for (process_id = &archive->process_id; *process_id == 0; );
-
- }
- else
- pthread_kill(archive->process_id, SIGUSR1);
-
- g_mutex_unlock(&archive->clients_access);
-
-
return DBE_NONE; ////
}