Ignore vconfkey value change for AVC mode on
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-rfcomm-client.c
index 99ad52a..5a3aebf 100644 (file)
@@ -352,12 +352,16 @@ static gboolean __client_data_received_cb(GIOChannel *chan, GIOCondition cond,
                BT_ERR("IO Channel read is failed with %d", status);
 
                g_free(buffer);
-               if (err) {
-                       BT_ERR("IO Channel read error [%s]", err->message);
-                       if (status == G_IO_STATUS_ERROR &&
-                                       __is_error_by_disconnect(err)) {
+               if (err || status == G_IO_STATUS_EOF) {
+                       if (err)
+                               BT_ERR("IO Channel read error [%s]", err->message);
+                       if ((status == G_IO_STATUS_EOF) ||
+                                       (status == G_IO_STATUS_ERROR &&
+                                       __is_error_by_disconnect(err))) {
+
                                BT_ERR("cond : %d", cond);
-                               g_error_free(err);
+                               if (err)
+                                       g_error_free(err);
 
                                conn_info = __get_conn_info_from_fd(info, fd);
                                if (conn_info == NULL) {
@@ -372,7 +376,8 @@ static gboolean __client_data_received_cb(GIOChannel *chan, GIOCondition cond,
                                __rfcomm_client_disconnect(info);
                                return FALSE;
                        }
-                       g_error_free(err);
+                       if (err)
+                               g_error_free(err);
                }
                return TRUE;
        }
@@ -1341,8 +1346,6 @@ BT_EXPORT_API int bluetooth_rfcomm_write(int fd, const char *buf, int length)
                return BLUETOOTH_ERROR_INVALID_PARAM;
        }
 
-       BT_DBG("FD : %d", fd);
-
        retv_if(length <= 0, BLUETOOTH_ERROR_INVALID_PARAM);
 
        switch (privilege_token) {