linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [BlueZ,v5] obex: Move size emit signal to plugins instead of obex.c
  2024-07-03  9:31 Amisha Jain
@ 2024-07-03 11:39 ` bluez.test.bot
  0 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-07-03 11:39 UTC (permalink / raw)
  To: linux-bluetooth, quic_amisjain

[-- Attachment #1: Type: text/plain, Size: 948 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=867906

---Test result---

Test Summary:
CheckPatch                    PASS      0.26 seconds
GitLint                       PASS      0.19 seconds
BuildEll                      PASS      24.36 seconds
BluezMake                     PASS      1645.76 seconds
MakeCheck                     PASS      13.08 seconds
MakeDistcheck                 PASS      177.29 seconds
CheckValgrind                 PASS      251.47 seconds
CheckSmatch                   PASS      352.37 seconds
bluezmakeextell               PASS      119.11 seconds
IncrementalBuild              PASS      1385.18 seconds
ScanBuild                     PASS      998.38 seconds



---
Regards,
Linux Bluetooth


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

* [PATCH BlueZ v5] obex: Move size emit signal to plugins instead of obex.c
@ 2024-07-23 11:05 Amisha Jain
  2024-07-23 12:47 ` [BlueZ,v5] " bluez.test.bot
  2024-07-23 17:12 ` [PATCH BlueZ v5] " Pauli Virtanen
  0 siblings, 2 replies; 4+ messages in thread
From: Amisha Jain @ 2024-07-23 11:05 UTC (permalink / raw)
  To: linux-bluetooth, pmenzel, luiz.dentz
  Cc: quic_mohamull, quic_hbandi, quic_anubhavg

Instead of emitting the property "Size" from obex_put_stream_start(),
Call the function manager_emit_transfer_property() from plugins/*.c
wherever plugin has transfer object present.
Remove the code from obex.c which is generic for all profiles.

This change resolves the type mismatch issue when calling the
manager_emit_transfer_property from obex.c. We are passing
'os->service_data' of plugin session type but the
manager_emit_transfer_property() expects the 'obex_transfer'
type, therefore size is not set properly and might cause
crash/disconnection.

---
 obexd/plugins/ftp.c | 5 +++++
 obexd/plugins/opp.c | 5 +++++
 obexd/src/obex.c    | 3 ---
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c
index 874fe2b8b..127bb9aaf 100644
--- a/obexd/plugins/ftp.c
+++ b/obexd/plugins/ftp.c
@@ -175,6 +175,11 @@ int ftp_chkput(struct obex_session *os, void *user_data)
 
 	ret = obex_put_stream_start(os, path);
 
+	if (obex_get_size(os) != OBJECT_SIZE_DELETE &&
+				obex_get_size(os) != OBJECT_SIZE_UNKNOWN) {
+		manager_emit_transfer_property(ftp->transfer, "Size");
+	}
+
 	if (ret == 0)
 		manager_emit_transfer_started(ftp->transfer);
 
diff --git a/obexd/plugins/opp.c b/obexd/plugins/opp.c
index 777f5f8ed..74b2f805b 100644
--- a/obexd/plugins/opp.c
+++ b/obexd/plugins/opp.c
@@ -87,6 +87,11 @@ skip_auth:
 
 	err = obex_put_stream_start(os, path);
 
+	if (obex_get_size(os) != OBJECT_SIZE_DELETE &&
+				obex_get_size(os) != OBJECT_SIZE_UNKNOWN) {
+		manager_emit_transfer_property(user_data, "Size");
+	}
+
 	g_free(path);
 
 	if (err < 0)
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 98d6245a4..370bfac9e 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -716,9 +716,6 @@ int obex_put_stream_start(struct obex_session *os, const char *filename)
 		return err;
 	}
 
-	if (os->size != OBJECT_SIZE_DELETE && os->size != OBJECT_SIZE_UNKNOWN)
-		manager_emit_transfer_property(os->service_data, "Size");
-
 	os->path = g_strdup(filename);
 
 	return 0;
-- 
2.17.1


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

* RE: [BlueZ,v5] obex: Move size emit signal to plugins instead of obex.c
  2024-07-23 11:05 [PATCH BlueZ v5] obex: Move size emit signal to plugins instead of obex.c Amisha Jain
@ 2024-07-23 12:47 ` bluez.test.bot
  2024-07-23 17:12 ` [PATCH BlueZ v5] " Pauli Virtanen
  1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-07-23 12:47 UTC (permalink / raw)
  To: linux-bluetooth, quic_amisjain

[-- Attachment #1: Type: text/plain, Size: 949 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=873215

---Test result---

Test Summary:
CheckPatch                    PASS      0.28 seconds
GitLint                       PASS      0.20 seconds
BuildEll                      PASS      25.67 seconds
BluezMake                     PASS      1798.24 seconds
MakeCheck                     PASS      13.50 seconds
MakeDistcheck                 PASS      185.50 seconds
CheckValgrind                 PASS      265.17 seconds
CheckSmatch                   PASS      374.25 seconds
bluezmakeextell               PASS      127.24 seconds
IncrementalBuild              PASS      1647.88 seconds
ScanBuild                     PASS      1098.73 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v5] obex: Move size emit signal to plugins instead of obex.c
  2024-07-23 11:05 [PATCH BlueZ v5] obex: Move size emit signal to plugins instead of obex.c Amisha Jain
  2024-07-23 12:47 ` [BlueZ,v5] " bluez.test.bot
@ 2024-07-23 17:12 ` Pauli Virtanen
  1 sibling, 0 replies; 4+ messages in thread
From: Pauli Virtanen @ 2024-07-23 17:12 UTC (permalink / raw)
  To: Amisha Jain, linux-bluetooth

Hi,

ti, 2024-07-23 kello 16:35 +0530, Amisha Jain kirjoitti:
> Instead of emitting the property "Size" from obex_put_stream_start(),
> Call the function manager_emit_transfer_property() from plugins/*.c
> wherever plugin has transfer object present.
> Remove the code from obex.c which is generic for all profiles.
> 
> This change resolves the type mismatch issue when calling the
> manager_emit_transfer_property from obex.c. We are passing
> 'os->service_data' of plugin session type but the
> manager_emit_transfer_property() expects the 'obex_transfer'
> type, therefore size is not set properly and might cause
> crash/disconnection.
> 
> ---
>  obexd/plugins/ftp.c | 5 +++++
>  obexd/plugins/opp.c | 5 +++++
>  obexd/src/obex.c    | 3 ---
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c
> index 874fe2b8b..127bb9aaf 100644
> --- a/obexd/plugins/ftp.c
> +++ b/obexd/plugins/ftp.c
> @@ -175,6 +175,11 @@ int ftp_chkput(struct obex_session *os, void *user_data)
>  
>  	ret = obex_put_stream_start(os, path);
>  
> +	if (obex_get_size(os) != OBJECT_SIZE_DELETE &&
> +				obex_get_size(os) != OBJECT_SIZE_UNKNOWN) {
> +		manager_emit_transfer_property(ftp->transfer, "Size");
> +	}

This probably should check ret == 0, to be exactly equivalent to what
it was before.

> +
>  	if (ret == 0)
>  		manager_emit_transfer_started(ftp->transfer);
>  
> diff --git a/obexd/plugins/opp.c b/obexd/plugins/opp.c
> index 777f5f8ed..74b2f805b 100644
> --- a/obexd/plugins/opp.c
> +++ b/obexd/plugins/opp.c
> @@ -87,6 +87,11 @@ skip_auth:
>  
>  	err = obex_put_stream_start(os, path);
>  
> +	if (obex_get_size(os) != OBJECT_SIZE_DELETE &&
> +				obex_get_size(os) != OBJECT_SIZE_UNKNOWN) {
> +		manager_emit_transfer_property(user_data, "Size");
> +	}
> +

Similarly err == 0 here.

Based on looking at the code looks otherwise OK, but haven't tested
this myself in practice.

>  	g_free(path);
>  
>  	if (err < 0)
> diff --git a/obexd/src/obex.c b/obexd/src/obex.c
> index 98d6245a4..370bfac9e 100644
> --- a/obexd/src/obex.c
> +++ b/obexd/src/obex.c
> @@ -716,9 +716,6 @@ int obex_put_stream_start(struct obex_session *os, const char *filename)
>  		return err;
>  	}
>  
> -	if (os->size != OBJECT_SIZE_DELETE && os->size != OBJECT_SIZE_UNKNOWN)
> -		manager_emit_transfer_property(os->service_data, "Size");
> -
>  	os->path = g_strdup(filename);
>  
>  	return 0;

-- 
Pauli Virtanen

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

end of thread, other threads:[~2024-07-23 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23 11:05 [PATCH BlueZ v5] obex: Move size emit signal to plugins instead of obex.c Amisha Jain
2024-07-23 12:47 ` [BlueZ,v5] " bluez.test.bot
2024-07-23 17:12 ` [PATCH BlueZ v5] " Pauli Virtanen
  -- strict thread matches above, loose matches on Subject: below --
2024-07-03  9:31 Amisha Jain
2024-07-03 11:39 ` [BlueZ,v5] " bluez.test.bot

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).