--- Begin Message ---
Send Commits mailing list submissions to
[EMAIL PROTECTED]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.moblin.org/mailman/listinfo/commits
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Commits digest..."
Today's Topics:
1. obexd: Changes to 'master' (Moblin Gitosis)
2. moblin-image-creator: Changes to 'master' (Prajwal Karur Mohan)
----------------------------------------------------------------------
Message: 1
Date: Tue, 18 Nov 2008 20:00:53 -0700 (MST)
From: [EMAIL PROTECTED] (Moblin Gitosis)
Subject: [Moblin-Commits] obexd: Changes to 'master'
To: [EMAIL PROTECTED],[EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
client/session.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++-----
client/session.h | 3 +-
gwobex/gw-obex.h | 9 ++++
gwobex/obex-priv.c | 7 ++-
gwobex/obex-xfer.c | 4 ++
src/main.c | 68 ++++++++++++++++++++++++++++++--
src/manager.c | 46 ++++++++++++++++++++++
src/obex.c | 13 +++++-
src/obex.h | 1 +
9 files changed, 238 insertions(+), 22 deletions(-)
New commits:
commit fda7b2d10e986597073c21113ce38bcb878595d0
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Tue Nov 18 16:36:23 2008 -0300
Avoids a memory leak when a async operation gets aborted
commit e3c8033a6eb55375d2b89dfeb68449c8be1ce289
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Tue Nov 18 10:48:34 2008 -0300
Sending a error message when some error occurs during folder listing
commit 6c5c7857add2fc98abc1b5956c16f4abe35d8058
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Mon Nov 17 20:50:15 2008 -0300
Fixes the case when serving folder listings bigger than MTU size
commit 58bf7b574a62c62e317ef37780f8db3ffbb5c39c
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Mon Nov 17 20:42:12 2008 -0300
Separate getting a folder listing from getting a file
As there are some special conditions involving a folder listing as
no object size, storing everything inside a buffer, this is better left
apart from the "normal" case.
commit 141cb555c090637db748d8b6726a34a0da5a0275
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Mon Nov 17 20:34:30 2008 -0300
Sends a final Progress message when the transfer is complete
commit 0462e6fc3f237179b6d54e5808e42d60ce08cd91
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Mon Nov 17 20:08:26 2008 -0300
Adds a way to determine that the transfer is done
commit 75093ee878f5505588060d0340197af622b7f253
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Mon Nov 17 20:01:38 2008 -0300
Adds support for dynamic buffers
commit 4800d13db9d5eccc9b33a61ca38995a2a4d71a82
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date: Fri Nov 14 15:17:24 2008 -0300
Checks for errors in write when receiving a object
commit 956ca1076147146d864bc18c6560b3a12866b763
Author: Johan Hedberg <[EMAIL PROTECTED]>
Date: Sun Nov 16 17:17:00 2008 +0200
Add Nokia PC Suite support
This patch adds a --pcsuite command line option which enables features
needed for Nokia PC Suite to work with obexd.
commit 78ff0406fc39ed45e189a5ea9111019e53e41dcf
Author: Johan Hedberg <[EMAIL PROTECTED]>
Date: Sat Nov 15 00:13:19 2008 +0200
Add support for reinitializing a tty based server
This patch adds support for retrying to open a tty when the daemon
receives a SIGUSR1 signal. This is e.g. needed for USB Gadget Serial so
that obexd can be notified that USB cable is plugged in and that a
matching device node is available.
Diff in this email is a maximum of 400 lines.
diff --git a/client/session.c b/client/session.c
index 4bbb0bb..6706d25 100644
--- a/client/session.c
+++ b/client/session.c
@@ -51,6 +51,8 @@
#define FTP_INTERFACE "org.openobex.FileTransfer"
+#define DEFAULT_BUFFER_SIZE 4096
+
static guint64 counter = 0;
struct callback_data {
@@ -116,6 +118,7 @@ static void session_unref(struct session_data *session)
g_free(session->agent_name);
g_free(session->agent_path);
g_free(session->owner);
+ g_free(session->buffer);
g_free(session);
}
@@ -943,6 +946,12 @@ static void unregister_transfer(struct session_data
*session)
g_free(session->name);
session->name = NULL;
+ g_free(session->buffer);
+ session->buffer = NULL;
+
+ session->buffer_len = 0;
+ session->filled = 0;
+
if (session->transfer_path == NULL)
return;
@@ -997,6 +1006,62 @@ static void get_file_callback(struct session_data
*session, void *user_data)
}
+static void get_xfer_listing_progress(GwObexXfer *xfer,
+ gpointer user_data)
+{
+ struct callback_data *callback = user_data;
+ struct session_data *session = callback->session;
+ gint bsize, bread, err = 0;
+
+ bsize = session->buffer_len - session->filled;
+
+ if (bsize < DEFAULT_BUFFER_SIZE) {
+ session->buffer_len += DEFAULT_BUFFER_SIZE;
+ session->buffer = g_realloc(session->buffer,
session->buffer_len);
+ bsize += DEFAULT_BUFFER_SIZE;
+ }
+
+ gw_obex_xfer_read(xfer, session->buffer + session->filled,
+ bsize, &bread, &err);
+
+
+ if (session->msg && err) {
+ DBusMessage *reply;
+
+ reply = g_dbus_create_error(session->msg,
+ "org.openobex.Error.Failed",
+ OBEX_ResponseToString(err));
+
+ g_dbus_send_message(session->conn, reply);
+
+ dbus_message_unref(session->msg);
+ session->msg = NULL;
+ }
+
+ if (err) {
+ fprintf(stderr, "gw_obex_xfer_read(): %s\n",
+ OBEX_ResponseToString(err));
+ goto complete;
+ }
+
+ session->filled += bread;
+
+ if (gw_obex_xfer_object_done(xfer))
+ goto complete;
+
+ return;
+
+complete:
+ if (err == 0)
+ callback->func(callback->session, callback->data);
+
+ unregister_transfer(session);
+
+ session_unref(callback->session);
+
+ g_free(callback);
+}
+
static void get_xfer_progress(GwObexXfer *xfer, gpointer user_data)
{
struct callback_data *callback = user_data;
@@ -1004,7 +1069,13 @@ static void get_xfer_progress(GwObexXfer *xfer, gpointer
user_data)
gint bsize, bread, err = 0;
gboolean ret;
- bsize = sizeof(session->buffer) - session->filled;
+ if (session->buffer_len == 0) {
+ session->buffer_len = DEFAULT_BUFFER_SIZE;
+ session->buffer = g_new0(char, DEFAULT_BUFFER_SIZE);
+ }
+
+ bsize = session->buffer_len - session->filled;
+
ret = gw_obex_xfer_read(xfer, session->buffer + session->filled,
bsize, &bread, &err);
@@ -1037,13 +1108,17 @@ static void get_xfer_progress(GwObexXfer *xfer,
gpointer user_data)
session->size = gw_obex_xfer_object_size(xfer);
if (session->fd > 0) {
- write(session->fd, session->buffer, bread);
+ gint w;
+
+ w = write(session->fd, session->buffer, bread);
+ if (w < 0) {
+ ret = FALSE;
+ goto complete;
+ }
+
session->filled = 0;
}
- if (session->size == -1)
- goto complete;
-
if (session->transferred == session->size)
goto complete;
@@ -1057,18 +1132,21 @@ static void get_xfer_progress(GwObexXfer *xfer,
gpointer user_data)
complete:
- if (ret == TRUE)
+ if (ret == TRUE) {
+ agent_notify_progress(session->conn, session->agent_name,
+ session->agent_path, session->transfer_path,
+ session->transferred);
agent_notify_complete(session->conn, session->agent_name,
session->agent_path, session->transfer_path);
- else
+ } else
agent_notify_error(session->conn, session->agent_name,
session->agent_path, session->transfer_path,
"Error getting object");
- unregister_transfer(session);
-
callback->func(callback->session, callback->data);
+ unregister_transfer(session);
+
if (session->fd > 0)
close(session->fd);
@@ -1135,7 +1213,11 @@ int session_get(struct session_data *session, const char
*type,
callback->session = session;
callback->func = func;
- gw_obex_xfer_set_callback(xfer, get_xfer_progress, callback);
+ if (type && g_str_equal(type, "x-obex/folder-listing"))
+ gw_obex_xfer_set_callback(xfer, get_xfer_listing_progress,
+ callback);
+ else
+ gw_obex_xfer_set_callback(xfer, get_xfer_progress, callback);
session->xfer = xfer;
@@ -1319,8 +1401,13 @@ static void put_xfer_progress(GwObexXfer *xfer, gpointer
user_data)
ssize_t len;
gint written;
+ if (session->buffer_len == 0) {
+ session->buffer_len = DEFAULT_BUFFER_SIZE;
+ session->buffer = g_new0(char, DEFAULT_BUFFER_SIZE);
+ }
+
len = read(session->fd, session->buffer + session->filled,
- sizeof(session->buffer) - session->filled);
+ session->buffer_len - session->filled);
if (len <= 0)
goto complete;
diff --git a/client/session.h b/client/session.h
index 16c3392..f0c113c 100644
--- a/client/session.h
+++ b/client/session.h
@@ -44,7 +44,8 @@ struct session_data {
DBusMessage *msg;
GwObex *obex;
GwObexXfer *xfer;
- char buffer[4096];
+ char *buffer;
+ size_t buffer_len;
int filled;
ssize_t size;
size_t transferred;
diff --git a/gwobex/gw-obex.h b/gwobex/gw-obex.h
index c1be103..94a6a64 100644
--- a/gwobex/gw-obex.h
+++ b/gwobex/gw-obex.h
@@ -511,6 +511,15 @@ time_t gw_obex_xfer_object_time(GwObexXfer *xfer);
gint gw_obex_xfer_object_size(GwObexXfer *xfer);
+/** Returns if a transfer is already done
+ *
+ * @param xfer Pointer returned by gw_obex_put_async or gw_obex_get_async
+ *
+ * @returns whether the current transfer is done
+ */
+gboolean gw_obex_xfer_object_done(GwObexXfer *xfer);
+
+
/** Supply more data to a transfer
*
* @param xfer Pointer returned by gw_obex_put_async or
gw_obex_get_async
diff --git a/gwobex/obex-priv.c b/gwobex/obex-priv.c
index a08599f..7352cdc 100644
--- a/gwobex/obex-priv.c
+++ b/gwobex/obex-priv.c
@@ -594,10 +594,11 @@ void obex_link_error(GwObex *ctx) {
}
if (ctx->xfer) {
/* Check that buffer is owned by us */
- if (!(ctx->obex_op == OBEX_CMD_PUT && ctx->xfer->stream_fd < 0))
+ if (!(ctx->obex_op == OBEX_CMD_PUT && ctx->xfer->stream_fd < 0)) {
g_free(ctx->xfer->buf);
- ctx->xfer->buf = NULL;
- ctx->xfer->buf_size = 0;
+ ctx->xfer->buf = NULL;
+ ctx->xfer->buf_size = 0;
+ }
ctx->xfer->do_cb = TRUE;
}
}
diff --git a/gwobex/obex-xfer.c b/gwobex/obex-xfer.c
index 1cce005..0f3248d 100644
--- a/gwobex/obex-xfer.c
+++ b/gwobex/obex-xfer.c
@@ -184,6 +184,10 @@ gint gw_obex_xfer_object_size(GwObexXfer *xfer) {
return xfer->target_size;
}
+gboolean gw_obex_xfer_object_done(GwObexXfer *xfer) {
+ return xfer->ctx->done;
+}
+
gboolean gw_obex_xfer_write(GwObexXfer *xfer, const char *buf, gint buf_size,
gint *bytes_written, gint *err) {
GwObex *ctx = xfer->ctx;
diff --git a/src/main.c b/src/main.c
index 9cdb20f..d8da5bd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,6 +52,7 @@
#define OPP_CHANNEL 9
#define FTP_CHANNEL 10
#define PBAP_CHANNEL 15
+#define PCSUITE_CHANNEL 24
#define DEFAULT_ROOT_PATH "/tmp"
@@ -59,6 +60,10 @@
static GMainLoop *main_loop = NULL;
+static int services = 0;
+static gboolean tty_needs_reinit = FALSE;
+static int signal_pipe[2];
+
int tty_init(int services, const gchar *root_path,
const gchar *capability, const gchar *devnode)
{
@@ -67,6 +72,8 @@ int tty_init(int services, const gchar *root_path,
int fd, ret;
glong flags;
+ tty_needs_reinit = TRUE;
+
fd = open(devnode, O_RDWR);
if (fd < 0)
return fd;
@@ -89,7 +96,8 @@ int tty_init(int services, const gchar *root_path,
if (ret < 0) {
server_free(server);
close(fd);
- }
+ } else
+ tty_needs_reinit = FALSE;
return ret;
}
@@ -110,6 +118,7 @@ static gboolean option_autoaccept = FALSE;
static gboolean option_opp = FALSE;
static gboolean option_ftp = FALSE;
static gboolean option_pbap = FALSE;
+static gboolean option_pcsuite = FALSE;
static GOptionEntry options[] = {
{ "nodaemon", 'n', G_OPTION_FLAG_REVERSE,
@@ -131,15 +140,60 @@ static GOptionEntry options[] = {
"Enable File Transfer server" },
{ "pbap", 'p', 0, G_OPTION_ARG_NONE, &option_pbap,
"Enable Phonebook Access server" },
+ { "pcsuite", 's', 0, G_OPTION_ARG_NONE, &option_pcsuite,
+ "Enable PC Suite Services server" },
{ NULL },
};
+static void sig_usr1(int sig)
+{
+ if (write(signal_pipe[1], &sig, sizeof(sig)) != sizeof(sig))
+ error("unable to write to signal pipe");
+}
+
+static gboolean handle_signal(GIOChannel *io, GIOCondition cond,
+ void *user_data)
+{
+ int sig, fd = g_io_channel_unix_get_fd(io);
+
+ if (read(fd, &sig, sizeof(sig)) != sizeof(sig)) {
+ error("handle_sigusr1: unable to read signal from pipe");
+ return TRUE;
+ }
+
+ if (sig == SIGUSR1 && tty_needs_reinit)
+ tty_init(services, option_root, option_capability,
+ option_devnode);
+
+ return TRUE;
+}
+
+static int devnode_setup(void)
+{
+ struct sigaction sa;
+ GIOChannel *pipe_io;
+
+ if (pipe(signal_pipe) < 0)
+ return -errno;
+
+ pipe_io = g_io_channel_unix_new(signal_pipe[0]);
+ g_io_add_watch(pipe_io, G_IO_IN, handle_signal, NULL);
+ g_io_channel_unref(pipe_io);
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = sig_usr1;
+ sigaction(SIGUSR1, &sa, NULL);
+
+ return tty_init(services, option_root, option_capability,
+ option_devnode);
+}
+
int main(int argc, char *argv[])
{
GOptionContext *context;
GError *err = NULL;
struct sigaction sa;
- int log_option = LOG_NDELAY | LOG_PID, services = 0;
+ int log_option = LOG_NDELAY | LOG_PID;
#ifdef NEED_THREADS
if (g_thread_supported() == FALSE)
@@ -223,9 +277,15 @@ int main(int argc, char *argv[])
PBAP_CHANNEL, TRUE, FALSE, NULL);
}
+ if (option_pcsuite == TRUE) {
+ services |= OBEX_PCSUITE;
+ bluetooth_init(OBEX_PCSUITE, "Nokia OBEX PC Suite Services",
+ option_root, PCSUITE_CHANNEL, TRUE,
+ option_autoaccept, option_capability);
+ }
+
if (option_devnode)
- tty_init(services, option_root, option_capability,
- option_devnode);
+ devnode_setup();
memset(&sa, 0, sizeof(sa));
sa.sa_handler = sig_term;
diff --git a/src/manager.c b/src/manager.c
index adcadb3..96bb098 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -170,6 +170,49 @@ const static gchar *pbap_record = "<?xml version=\"1.0\"
encoding=\"UTF-8\" ?> \
</attribute>
\
</record>";
+const static gchar *pcsuite_record =
+"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
\
+<record>
\
+ <attribute id=\"0x0001\">
\
+ <sequence>
\
+ <uuid value=\"00005005-0000-1000-8000-0002ee000001\"/>
\
------------------------------
Message: 2
Date: Wed, 19 Nov 2008 11:15:36 -0700 (MST)
From: [EMAIL PROTECTED] (Prajwal Karur Mohan)
Subject: [Moblin-Commits] moblin-image-creator: Changes to 'master'
To: [EMAIL PROTECTED],[EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
debian/changelog | 5 +++--
platforms/common-yum/install.sh | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 17ba8cff47a24ac9095843e0e20c379458a6032d
Author: Prajwal Mohan <[EMAIL PROTECTED]>
Date: Wed Nov 19 10:09:05 2008 -0800
Adding mount in install script
Diff in this email is a maximum of 400 lines.
diff --git a/debian/changelog b/debian/changelog
index d53eb90..5cc3c5b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,9 +11,10 @@ moblin-image-creator (0.48) gaston; urgency=low
* Updated ja.po.
[ Prajwal Mohan ]
- * Adding update column in targer view
+ * Adding update column in targer view
+ * Adding mount in install script
- -- Prajwal Mohan <[EMAIL PROTECTED]> Thu, 13 Nov 2008 11:14:17 -0800
+ -- Prajwal Mohan <[EMAIL PROTECTED]> Wed, 19 Nov 2008 10:08:42 -0800
moblin-image-creator (0.47) gaston; urgency=low
diff --git a/platforms/common-yum/install.sh b/platforms/common-yum/install.sh
index b849fce..dd76dea 100755
--- a/platforms/common-yum/install.sh
+++ b/platforms/common-yum/install.sh
@@ -160,6 +160,8 @@ EOF
fi
sync
+mount /dev/sde /foo
+sync
splash_progress 10
splash_delay 10
------------------------------
_______________________________________________
Commits mailing list
[EMAIL PROTECTED]
https://lists.moblin.org/mailman/listinfo/commits
End of Commits Digest, Vol 16, Issue 20
***************************************
--- End Message ---