Fix p2p bug and various warnings 1.0 1.0_branch
authorOlivier Guiter <olivier.guiter@linux.intel.com>
Mon, 15 Oct 2012 09:59:51 +0000 (11:59 +0200)
committerOlivier Guiter <olivier.guiter@linux.intel.com>
Mon, 15 Oct 2012 09:59:51 +0000 (11:59 +0200)
packaging/neard.spec
plugins/handover.c
plugins/p2p.c
src/bluetooth.c
src/ndef.c

index f494b6c..b4729ab 100644 (file)
@@ -3,7 +3,7 @@
 Name:      neard
 Summary:    Near Field Communication Manager
 Version:    0.7
-Release:    1
+Release:    2
 Group:      System Environment/Daemons
 License:    GPLv2
 Source0:    http://www.kernel.org/pub/linux/network/nfc/%{name}-%{version}.tar.bz2
index 5d6c087..2e9ffb9 100644 (file)
@@ -398,7 +398,6 @@ static void free_hr_push_client(struct hr_push_client *client, int status)
        DBG("");
 
        handover_close(client->fd, 0);
-       close(client->fd);
 
        if (client->cb)
                client->cb(client->adapter_idx, client->target_idx, status);
@@ -462,9 +461,13 @@ static int handover_push(int client_fd,
                                        G_IO_ERR, handover_push_event,
                                        (gpointer) client);
 
+       g_io_channel_unref(channel);
+
        err = send(client_fd, ndef->data, ndef->length, MSG_DONTWAIT);
-       if (err < 0)
+       if (err < 0) {
                free_hr_push_client(client, err);
+               g_io_channel_unref(channel);
+       }
 
        return err;
 }
index 845165f..7730bcb 100644 (file)
@@ -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;
        }
 
index 60c65e3..9600b2f 100644 (file)
@@ -211,7 +211,7 @@ static void bt_create_paired_device_cb(DBusPendingCall *pending,
                goto cb_done;
        }
 
-       near_info("Pairing done successfully !");
+       DBG("Successful pairing");
 
 cb_done:
        /* task completed - clean memory*/
index 9392b4b..547df70 100644 (file)
@@ -1796,7 +1796,8 @@ struct near_ndef_message *near_ndef_prepare_handover_record(char* type_name,
 
        g_free(oob_data);
 
-       near_info("handover select record preparation OK");
+       DBG("Hs NDEF done");
+
        return hs_msg;
 
 fail:
@@ -2042,7 +2043,8 @@ static struct near_ndef_ho_record *parse_ho_record(enum record_type rec_type,
        if (near_fill_ho_record(ho_record, acs, mimes) < 0)
                goto fail;
 
-       near_error("handover record parsing complete");
+       DBG("handover record parsing complete");
+
        return ho_record;
 
 fail: