diff options
Diffstat (limited to 'src/analysis/db/client.c')
-rw-r--r-- | src/analysis/db/client.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/analysis/db/client.c b/src/analysis/db/client.c index c19a39e..f0d3d4b 100644 --- a/src/analysis/db/client.c +++ b/src/analysis/db/client.c @@ -162,7 +162,7 @@ static void g_db_client_finalize(GDbClient *client) * * ******************************************************************************/ -GDbClient *g_db_client_new(const char *name, const char *hash, GDbCollection *collections) +GDbClient *g_db_client_new(const char *name, const char *hash, GList *collections) { GDbClient *result; /* Adresse à retourner */ @@ -257,7 +257,8 @@ bool g_db_client_start(GDbClient *client, const char *host, unsigned short port, /** * Le serveur doit répondre pour un message type : * - la commande 'DBC_WELCOME'. - * - un identifiant d'erreur ('DBE_NONE' ou 'DBE_WRONG_VERSION'). + * - un identifiant d'erreur ('DBE_NONE', 'DBE_BAD_EXCHANGE' + * ou 'DBE_WRONG_VERSION' ... 'DBE_LOADING_ERROR'). */ if (!safe_recv(client->fd, &data, sizeof(uint32_t), 0)) @@ -286,8 +287,21 @@ bool g_db_client_start(GDbClient *client, const char *host, unsigned short port, goto gdcs_error; break; + case DBE_XML_VERSION_ERROR: + log_variadic_message(LMT_ERROR, _("The archive from the server '%s:%hu' does not use our protocol version (0x%08x)..."), + host, port, CDB_PROTOCOL_VERSION); + goto gdcs_error; + break; + + case DBE_DB_LOADING_ERROR: + log_variadic_message(LMT_ERROR, _("The server '%s:%hu' got into troubles while loading the database...."), + host, port); + goto gdcs_error; + break; + default: - log_variadic_message(LMT_ERROR, _("The server '%s:%hu' uses an unknown protocol..."), host, port); + log_variadic_message(LMT_ERROR, _("The server '%s:%hu' has run into an error (%u)..."), + host, port, error); goto gdcs_error; break; |