From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH obexd 2/3] client: add FileTransfer.CopyFile implementation
Date: Fri, 12 Aug 2011 15:46:43 +0300 [thread overview]
Message-ID: <1313153204-16301-2-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1313153204-16301-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
client/ftp.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/client/ftp.c b/client/ftp.c
index 4c04eda..87116cc 100644
--- a/client/ftp.c
+++ b/client/ftp.c
@@ -310,6 +310,25 @@ static DBusMessage *put_file(DBusConnection *connection,
static DBusMessage *copy_file(DBusConnection *connection,
DBusMessage *message, void *user_data)
{
+ struct ftp_data *ftp = user_data;
+ struct obc_session *session = ftp->session;
+ GwObex *obex = obc_session_get_obex(session);
+ const char *filename, *destname;
+ int err;
+
+ if (dbus_message_get_args(message, NULL,
+ DBUS_TYPE_STRING, &filename,
+ DBUS_TYPE_STRING, &destname,
+ DBUS_TYPE_INVALID) == FALSE)
+ return g_dbus_create_error(message,
+ "org.openobex.Error.InvalidArguments", NULL);
+
+ if (gw_obex_copy(obex, filename, destname, &err) == FALSE) {
+ return g_dbus_create_error(message,
+ "org.openobex.Error.Failed",
+ "%s", OBEX_ResponseToString(err));
+ }
+
return dbus_message_new_method_return(message);
}
--
1.7.6
next prev parent reply other threads:[~2011-08-12 12:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-12 12:46 [PATCH obexd 1/3] client: add FileTransfer.MoveFile implementation Luiz Augusto von Dentz
2011-08-12 12:46 ` Luiz Augusto von Dentz [this message]
2011-08-12 12:46 ` [PATCH obexd 3/3] Add move and copy support to ftp-client Luiz Augusto von Dentz
2011-08-22 7:37 ` [PATCH obexd 1/3] client: add FileTransfer.MoveFile implementation Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313153204-16301-2-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).