From 4fafb9bae767e91a6dbf1d711b319dc114117e05 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 24 Oct 2008 18:48:18 -0300 Subject: [PATCH] obexd: Added target_len in the session_data struct --- obexd/client/session.c | 7 ++++--- obexd/client/session.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/obexd/client/session.c b/obexd/client/session.c index f90362232..7e06ee314 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 aea62a294..e78e533cb 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; -- 2.47.3