From dfa7e04b4a267f7f30086510781ca3221b7e25f8 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Tue, 10 Feb 2015 21:14:18 +0000
Subject: Fixed a bug by reordering the first exchanges.

git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@469 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
---
 ChangeLog             |  5 +++++
 src/analysis/db/cdb.c | 30 +++++++++++++-----------------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96684d0..c1e6d79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+15-02-10  Cyrille Bagard <nocbos@gmail.com>
+
+	* src/analysis/db/cdb.c:
+	Fix a bug by reordering the first exchanges.
+
 15-02-09  Cyrille Bagard <nocbos@gmail.com>
 
 	* src/analysis/binary.c:
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;    ////
 
 }
-- 
cgit v0.11.2-87-g4458