mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-03 00:54:20 +08:00
obexd: Use utility function to report transfer progress
This commit is contained in:
parent
2ec536a9e8
commit
aeeacf204d
@ -1128,7 +1128,6 @@ static GDBusMethodTable ftp_methods[] = {
|
|||||||
static void put_xfer_progress(GwObexXfer *xfer, gpointer user_data)
|
static void put_xfer_progress(GwObexXfer *xfer, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct session_data *session = user_data;
|
struct session_data *session = user_data;
|
||||||
DBusMessage *message;
|
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
gint written;
|
gint written;
|
||||||
|
|
||||||
@ -1150,20 +1149,9 @@ static void put_xfer_progress(GwObexXfer *xfer, gpointer user_data)
|
|||||||
|
|
||||||
session->transferred += written;
|
session->transferred += written;
|
||||||
|
|
||||||
if (session->agent_name == NULL || session->agent_path == NULL)
|
agent_notify_progress(session->conn, session->agent_name,
|
||||||
return;
|
session->agent_path, session->transfer_path,
|
||||||
|
session->transferred);
|
||||||
message = dbus_message_new_method_call(session->agent_name,
|
|
||||||
session->agent_path, AGENT_INTERFACE, "Progress");
|
|
||||||
|
|
||||||
dbus_message_set_no_reply(message, TRUE);
|
|
||||||
|
|
||||||
dbus_message_append_args(message, DBUS_TYPE_OBJECT_PATH, &session->transfer_path,
|
|
||||||
DBUS_TYPE_UINT64, &session->transferred,
|
|
||||||
DBUS_TYPE_INVALID);
|
|
||||||
|
|
||||||
g_dbus_send_message(session->conn, message);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
complete:
|
complete:
|
||||||
|
Loading…
Reference in New Issue
Block a user