summaryrefslogtreecommitdiff
path: root/src/analysis/db
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-04-07 10:59:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-04-07 10:59:13 (GMT)
commit3e8341ca17547db1dcf28c99d6fc68fe6901573b (patch)
tree57d867d97aa4df4496fe46b46c55b3c02537fd26 /src/analysis/db
parent18d6b808db6e31e867525d68f92d6f928a7ab5a7 (diff)
Relied on Cairo for printing code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@369 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/db')
-rw-r--r--src/analysis/db/server.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/analysis/db/server.c b/src/analysis/db/server.c
index b636d02..acdf200 100644
--- a/src/analysis/db/server.c
+++ b/src/analysis/db/server.c
@@ -33,6 +33,7 @@
#include "protocol.h"
+#include "../../gui/panels/log.h"
@@ -53,7 +54,8 @@ struct _GDbServer
{
GObject parent; /* A laisser en premier */
- int fd;
+ int fd; /* Canal de communication */
+ char *hostname; /* Désignation humaine */
struct sockaddr_in addr; /* Adresse d'écoute */
GThread *listener; /* Procédure de traitement */
@@ -139,7 +141,7 @@ static void g_db_server_init(GDbServer *server)
/******************************************************************************
* *
-* Paramètres : binary = instance d'objet GLib à traiter. *
+* Paramètres : server = instance d'objet GLib à traiter. *
* *
* Description : Procède à la libération totale de la mémoire. *
* *
@@ -149,11 +151,11 @@ static void g_db_server_init(GDbServer *server)
* *
******************************************************************************/
-static void g_db_server_finalize(GDbServer *binary)
+static void g_db_server_finalize(GDbServer *server)
{
- //free(binary->filename);
+ free(server->hostname);
- G_OBJECT_CLASS(g_db_server_parent_class)->finalize(G_OBJECT(binary));
+ G_OBJECT_CLASS(g_db_server_parent_class)->finalize(G_OBJECT(server));
}
@@ -178,6 +180,8 @@ GDbServer *g_db_server_new(const char *host, short port)
result = g_object_new(G_TYPE_DB_SERVER, NULL);
+ result->hostname = strdup(host);
+
hp = gethostbyname(host);
if (hp == NULL) goto gdsn_error;
@@ -383,6 +387,9 @@ bool g_db_server_start(GDbServer *server)
server->listener = g_thread_new("cdb_listener", (GThreadFunc)g_db_server_listener, server);
+ log_variadic_message(LMT_PROCESS, _("Server started and listening at %s:%hu"),
+ server->hostname, ntohs(server->addr.sin_port));
+
return true;
}