Diff between 0b0e51f7c61c013c7f50ef749cdec51d89b4b10c and 4fafb9bae767e91a6dbf1d711b319dc114117e05

Changed Files

File Additions Deletions Status
obexd/client/session.c +4 -3 modified
obexd/client/session.h +1 -0 modified

Full Patch

diff --git a/obexd/client/session.c b/obexd/client/session.c
index f903622..7e06ee3 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -122,15 +122,15 @@ static gboolean rfcomm_callback(GIOChannel *io, GIOCondition cond,
 	struct callback_data *callback = user_data;
 	struct session_data *session = callback->session;
 	GwObex *obex;
-	int fd, len;
+	int fd;
 
 	if (cond & (G_IO_NVAL | G_IO_ERR))
 		goto done;
 
 	fd = g_io_channel_unix_get_fd(io);
 
-	len = (session->target ? 16 : 0);
-	obex = gw_obex_setup_fd(fd, session->target, len, NULL, NULL);
+	obex = gw_obex_setup_fd(fd, session->target,
+			session->target_len, NULL, NULL);
 
 	callback->session->sock = fd;
 	callback->session->obex = obex;
@@ -385,6 +385,7 @@ int session_create(const char *source,
 	if (target != NULL) {
 		session->uuid = OBEX_FILETRANS_SVCLASS_ID;
 		session->target = FOLDER_BROWSING_UUID;
+		session->target_len = 16;
 	} else
 		session->uuid = OBEX_OBJPUSH_SVCLASS_ID;
 
diff --git a/obexd/client/session.h b/obexd/client/session.h
index aea62a2..e78e533 100644
--- a/obexd/client/session.h
+++ b/obexd/client/session.h
@@ -33,6 +33,7 @@ struct session_data {
 	bdaddr_t dst;
 	uint8_t channel;
 	const char *target;	/* OBEX Target UUID */
+	int target_len;
 	uint16_t uuid;		/* Bluetooth Service Class */
 	gchar *name;
 	gchar *path;