diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-03-31 09:29:30 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-03-31 11:08:33 +0100 |
commit | 37da8370cac07133af6d36a3b8403b70405ef220 (patch) | |
tree | e59ef1aa9cf73dd21ce3676b15ac19e478b8d761 | |
parent | 9c4b6aaabcd57a48c8ae7c2e734e419336347c61 (diff) |
meta-porter: also debug what IP a new connection is from
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | wocky/wocky-meta-porter.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wocky/wocky-meta-porter.c b/wocky/wocky-meta-porter.c index 143a5c6..a4d0e2b 100644 --- a/wocky/wocky-meta-porter.c +++ b/wocky/wocky-meta-porter.c @@ -444,17 +444,25 @@ new_connection_connect_cb (GObject *source, static gboolean _new_connection (GSocketService *service, - GSocketConnection *socket, + GSocketConnection *socket_connection, GObject *source_object, gpointer user_data) { WockyMetaPorter *self = user_data; + GSocketAddress *addr = g_socket_connection_get_remote_address ( + socket_connection, NULL); + GInetAddress *inet_address = g_inet_socket_address_get_address ( + G_INET_SOCKET_ADDRESS (addr)); + gchar *str = g_inet_address_to_string (inet_address); - DEBUG ("new connection!"); + DEBUG ("new connection from %s!", str); - wocky_ll_connector_incoming_async (G_IO_STREAM (socket), + wocky_ll_connector_incoming_async (G_IO_STREAM (socket_connection), NULL, new_connection_connect_cb, self); + g_free (str); + g_object_unref (addr); + return TRUE; } |