summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-10-12 14:51:37 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-12 14:51:37 +0200
commitbdff443eda604cf38f32c2760f4fb5d01ba1d920 (patch)
treed44562fbb692251f23846310bd9ef547a6bf48b0
parenta863d204e0ab5ca54e972ca21a7b4644576992b3 (diff)
downloadneard-bdff443eda604cf38f32c2760f4fb5d01ba1d920.tar.gz
neard-bdff443eda604cf38f32c2760f4fb5d01ba1d920.tar.bz2
neard-bdff443eda604cf38f32c2760f4fb5d01ba1d920.zip
handover: No need to explicitely close the server socket
gio will do that when the channel refcount drops to 0.
-rw-r--r--plugins/p2p.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/p2p.c b/plugins/p2p.c
index 845165f..7730bcb 100644
--- a/plugins/p2p.c
+++ b/plugins/p2p.c
@@ -129,6 +129,7 @@ static void free_server_data(gpointer data)
g_source_remove(server_data->watch);
server_data->watch = 0;
g_list_free_full(server_data->client_list, free_client_data);
+ server_data->client_list = NULL;
DBG("Closing server socket");
@@ -155,9 +156,9 @@ static gboolean p2p_listener_event(GIOChannel *channel, GIOCondition condition,
if (server_data->watch > 0)
g_source_remove(server_data->watch);
server_data->watch = 0;
- g_list_free_full(server_data->client_list, free_client_data);
- close(server_fd);
+ g_list_free_full(server_data->client_list, free_client_data);
+ server_data->client_list = NULL;
near_error("Error with %s server channel", driver->name);
@@ -170,7 +171,6 @@ static gboolean p2p_listener_event(GIOChannel *channel, GIOCondition condition,
if (client_fd < 0) {
near_error("accept failed %d", client_fd);
- close(server_fd);
return FALSE;
}