public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] obexd: Fix transfer status change
@ 2025-11-25  9:38 Kirill Samburskiy
  2025-11-25  9:38 ` [PATCH BlueZ 1/1] obexd: Always flush tranfser status changes. Set status to queued before starting Kirill Samburskiy
  2025-11-26 16:40 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 4+ messages in thread
From: Kirill Samburskiy @ 2025-11-25  9:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Kirill Samburskiy

See the issue for details: https://github.com/bluez/bluez/issues/1683

Kirill Samburskiy (1):
  obexd: Always flush tranfser status changes. Set status to queued
    before starting

 obexd/plugins/opp.c | 2 ++
 obexd/src/manager.c | 9 ++++++++-
 obexd/src/manager.h | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH BlueZ 1/1] obexd: Always flush tranfser status changes. Set status to queued before starting
  2025-11-25  9:38 [PATCH BlueZ 0/1] obexd: Fix transfer status change Kirill Samburskiy
@ 2025-11-25  9:38 ` Kirill Samburskiy
  2025-11-25 10:35   ` obexd: Fix transfer status change bluez.test.bot
  2025-11-26 16:40 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
  1 sibling, 1 reply; 4+ messages in thread
From: Kirill Samburskiy @ 2025-11-25  9:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Kirill Samburskiy

When transferring multiple files in the same session, obexd reuses the
same obex_transfer object to communicate transfer state to agents.
Because of that every transfer except the first one starts with its
status being "completed". If in addition to that, if the file size is
0 bytes, then the transfer status will change to "active" and then
immediately to "completed", but only change to "completed" will be
signaled through D-Bus. Such status change from "completed" to
"completed" is invalid and can cause issues with some agents. To
resolve the issue, always signal status changes, and set status to
"queued" before starting the transfer.

Fixes: https://github.com/bluez/bluez/issues/1683
---
 obexd/plugins/opp.c | 2 ++
 obexd/src/manager.c | 9 ++++++++-
 obexd/src/manager.h | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/obexd/plugins/opp.c b/obexd/plugins/opp.c
index 2220efd49..57bc0e7b9 100644
--- a/obexd/plugins/opp.c
+++ b/obexd/plugins/opp.c
@@ -58,6 +58,8 @@ static int opp_chkput(struct obex_session *os, void *user_data)
 	if (t != NULL && !is_filename(t))
 		return -EBADR;
 
+	manager_emit_transfer_queued(user_data);
+
 	if (obex_option_auto_accept()) {
 		folder = g_strdup(obex_option_root_folder());
 		name = g_strdup(obex_get_name(os));
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 683dd4ca0..89b3d04fd 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -528,7 +528,7 @@ void manager_emit_transfer_property(struct obex_transfer *transfer,
 	if (transfer->path == NULL)
 		return;
 
-	if (strcasecmp("Size", name) == 0)
+	if (strcasecmp("Size", name) == 0 || strcasecmp("Status", name) == 0)
 		g_dbus_emit_property_changed_full(connection, transfer->path,
 					TRANSFER_INTERFACE, name,
 					G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH);
@@ -537,6 +537,13 @@ void manager_emit_transfer_property(struct obex_transfer *transfer,
 						TRANSFER_INTERFACE, name);
 }
 
+void manager_emit_transfer_queued(struct obex_transfer *transfer)
+{
+	transfer->status = TRANSFER_STATUS_QUEUED;
+
+	manager_emit_transfer_property(transfer, "Status");
+}
+
 void manager_emit_transfer_started(struct obex_transfer *transfer)
 {
 	transfer->status = TRANSFER_STATUS_ACTIVE;
diff --git a/obexd/src/manager.h b/obexd/src/manager.h
index 8fa12d15d..76869e3c8 100644
--- a/obexd/src/manager.h
+++ b/obexd/src/manager.h
@@ -22,6 +22,7 @@ struct obex_transfer *manager_register_transfer(struct obex_session *os);
 void manager_unregister_transfer(struct obex_transfer *transfer);
 void manager_emit_transfer_property(struct obex_transfer *transfer,
 								char *name);
+void manager_emit_transfer_queued(struct obex_transfer *transfer);
 void manager_emit_transfer_started(struct obex_transfer *transfer);
 void manager_emit_transfer_progress(struct obex_transfer *transfer);
 void manager_emit_transfer_completed(struct obex_transfer *transfer);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: obexd: Fix transfer status change
  2025-11-25  9:38 ` [PATCH BlueZ 1/1] obexd: Always flush tranfser status changes. Set status to queued before starting Kirill Samburskiy
@ 2025-11-25 10:35   ` bluez.test.bot
  0 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2025-11-25 10:35 UTC (permalink / raw)
  To: linux-bluetooth, k.samburskiy

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1027279

---Test result---

Test Summary:
CheckPatch                    PENDING   0.38 seconds
GitLint                       PENDING   0.32 seconds
BuildEll                      PASS      20.06 seconds
BluezMake                     PASS      630.43 seconds
MakeCheck                     PASS      21.64 seconds
MakeDistcheck                 PASS      238.55 seconds
CheckValgrind                 PASS      294.69 seconds
CheckSmatch                   PASS      342.73 seconds
bluezmakeextell               PASS      181.58 seconds
IncrementalBuild              PENDING   0.34 seconds
ScanBuild                     PASS      973.81 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ 0/1] obexd: Fix transfer status change
  2025-11-25  9:38 [PATCH BlueZ 0/1] obexd: Fix transfer status change Kirill Samburskiy
  2025-11-25  9:38 ` [PATCH BlueZ 1/1] obexd: Always flush tranfser status changes. Set status to queued before starting Kirill Samburskiy
@ 2025-11-26 16:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2025-11-26 16:40 UTC (permalink / raw)
  To: Kirill Samburskiy; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 25 Nov 2025 12:38:34 +0300 you wrote:
> See the issue for details: https://github.com/bluez/bluez/issues/1683
> 
> Kirill Samburskiy (1):
>   obexd: Always flush tranfser status changes. Set status to queued
>     before starting
> 
>  obexd/plugins/opp.c | 2 ++
>  obexd/src/manager.c | 9 ++++++++-
>  obexd/src/manager.h | 1 +
>  3 files changed, 11 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,1/1] obexd: Always flush tranfser status changes. Set status to queued before starting
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d4218235678c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-26 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25  9:38 [PATCH BlueZ 0/1] obexd: Fix transfer status change Kirill Samburskiy
2025-11-25  9:38 ` [PATCH BlueZ 1/1] obexd: Always flush tranfser status changes. Set status to queued before starting Kirill Samburskiy
2025-11-25 10:35   ` obexd: Fix transfer status change bluez.test.bot
2025-11-26 16:40 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox