* [PATCH] gdbus: Drop message replies if the sender requested no reply
@ 2015-12-02 15:17 Philip Withnall
0 siblings, 0 replies; 6+ messages in thread
From: Philip Withnall @ 2015-12-02 15:17 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1.1: Type: text/plain, Size: 1524 bytes --]
If the sender flags a D-Bus message as not expecting a reply, it is
against system bus policy to send a reply — sending one will result in
errors being sent to us by dbus-daemon.
Magically drop all replies to messages which request no reply.
ofonod is one process which sends BlueZ messages which request no
reply,
when it is setting up a hands-free agent.
This is not a complete fix. In an ideal world, the existing check for
G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
prepared to return a reply to every method, if the client requests and
expects one — otherwise the client will time out. However, that’s a
much
bigger change with a much bigger risk of breaking things, so I’ll stick
with this for now.
Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
---
gdbus/object.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdbus/object.c b/gdbus/object.c
index 4cf2e2f..945dbdb 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -258,7 +258,8 @@ static DBusHandlerResult
process_message(DBusConnection *connection,
reply = method->function(connection, message,
iface_user_data);
- if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) {
+ if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY ||
+ dbus_message_get_no_reply(message)) {
if (reply != NULL)
dbus_message_unref(reply);
return DBUS_HANDLER_RESULT_HANDLED;
--
2.5.0
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5445 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] gdbus: Drop message replies if the sender requested no reply
@ 2015-12-02 15:36 Philip Withnall
2015-12-04 12:32 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 6+ messages in thread
From: Philip Withnall @ 2015-12-02 15:36 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 1524 bytes --]
If the sender flags a D-Bus message as not expecting a reply, it is
against system bus policy to send a reply — sending one will result in
errors being sent to us by dbus-daemon.
Magically drop all replies to messages which request no reply.
ofonod is one process which sends BlueZ messages which request no
reply,
when it is setting up a hands-free agent.
This is not a complete fix. In an ideal world, the existing check for
G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
prepared to return a reply to every method, if the client requests and
expects one — otherwise the client will time out. However, that’s a
much
bigger change with a much bigger risk of breaking things, so I’ll stick
with this for now.
Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
---
gdbus/object.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdbus/object.c b/gdbus/object.c
index 4cf2e2f..945dbdb 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -258,7 +258,8 @@ static DBusHandlerResult
process_message(DBusConnection *connection,
reply = method->function(connection, message,
iface_user_data);
- if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) {
+ if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY ||
+ dbus_message_get_no_reply(message)) {
if (reply != NULL)
dbus_message_unref(reply);
return DBUS_HANDLER_RESULT_HANDLED;
--
2.5.0
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] gdbus: Drop message replies if the sender requested no reply
@ 2015-12-02 15:44 Philip Withnall
2016-01-05 5:36 ` Denis Kenzior
0 siblings, 1 reply; 6+ messages in thread
From: Philip Withnall @ 2015-12-02 15:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]
If the sender flags a D-Bus message as not expecting a reply, it is
against system bus policy to send a reply — sending one will result in
errors being sent to us by dbus-daemon.
Magically drop all replies to messages which request no reply.
This is not a complete fix. In an ideal world, the existing check for
G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
prepared to return a reply to every method, if the client requests and
expects one — otherwise the client will time out. However, that’s a
much
bigger change with a much bigger risk of breaking things, so I’ll stick
with this for now.
Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
---
gdbus/object.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdbus/object.c b/gdbus/object.c
index 96db516..146a255 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -258,7 +258,8 @@ static DBusHandlerResult
process_message(DBusConnection *connection,
reply = method->function(connection, message,
iface_user_data);
- if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) {
+ if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY ||
+ dbus_message_get_no_reply(message)) {
if (reply != NULL)
dbus_message_unref(reply);
return DBUS_HANDLER_RESULT_HANDLED;
--
2.5.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gdbus: Drop message replies if the sender requested no reply
2015-12-02 15:36 Philip Withnall
@ 2015-12-04 12:32 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2015-12-04 12:32 UTC (permalink / raw)
To: Philip Withnall; +Cc: linux-bluetooth@vger.kernel.org
Hi Philip,
On Wed, Dec 2, 2015 at 5:36 PM, Philip Withnall
<philip.withnall@collabora.co.uk> wrote:
> If the sender flags a D-Bus message as not expecting a reply, it is
> against system bus policy to send a reply — sending one will result in
> errors being sent to us by dbus-daemon.
>
> Magically drop all replies to messages which request no reply.
>
> ofonod is one process which sends BlueZ messages which request no
> reply,
> when it is setting up a hands-free agent.
>
> This is not a complete fix. In an ideal world, the existing check for
> G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
> prepared to return a reply to every method, if the client requests and
> expects one — otherwise the client will time out. However, that’s a
> much
> bigger change with a much bigger risk of breaking things, so I’ll stick
> with this for now.
>
> Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
> ---
> gdbus/object.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gdbus/object.c b/gdbus/object.c
> index 4cf2e2f..945dbdb 100644
> --- a/gdbus/object.c
> +++ b/gdbus/object.c
> @@ -258,7 +258,8 @@ static DBusHandlerResult
> process_message(DBusConnection *connection,
>
> reply = method->function(connection, message,
> iface_user_data);
>
> - if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) {
> + if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY ||
> + dbus_message_get_no_reply(message)) {
> if (reply != NULL)
> dbus_message_unref(reply);
> return DBUS_HANDLER_RESULT_HANDLED;
> --
> 2.5.0
I fixed the coding style and remove Signed-off-by/Reviewed-By as those
are not used in userspace.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gdbus: Drop message replies if the sender requested no reply
2015-12-02 15:44 Philip Withnall
@ 2016-01-05 5:36 ` Denis Kenzior
0 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2016-01-05 5:36 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]
Hi Philip,
On 12/02/2015 09:44 AM, Philip Withnall wrote:
> If the sender flags a D-Bus message as not expecting a reply, it is
> against system bus policy to send a reply — sending one will result in
> errors being sent to us by dbus-daemon.
>
> Magically drop all replies to messages which request no reply.
>
> This is not a complete fix. In an ideal world, the existing check for
> G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
> prepared to return a reply to every method, if the client requests and
> expects one — otherwise the client will time out. However, that’s a
> much
> bigger change with a much bigger risk of breaking things, so I’ll stick
> with this for now.
>
> Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
No Signed-off-by or Reviewed-by lines please.
> ---
> gdbus/object.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Doesn't apply:
Applying: gdbus: Drop message replies if the sender requested no reply
fatal: corrupt patch at line 10
Patch failed at 0001 gdbus: Drop message replies if the sender requested
no reply
The copy of the patch that failed is found in:
Regards,
-Denis
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gdbus: Drop message replies if the sender requested no reply
[not found] <1452297478.3610.4.camel@tecnocode.co.uk>
@ 2016-01-11 17:20 ` Denis Kenzior
0 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2016-01-11 17:20 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]
Hi Philip,
On 01/08/2016 05:57 PM, Philip Withnall wrote:
> If the sender flags a D-Bus message as not expecting a reply, it is
> against system bus policy to send a reply — sending one will result in
> errors being sent to us by dbus-daemon.
>
> Magically drop all replies to messages which request no reply.
>
> This is not a complete fix. In an ideal world, the existing check for
> G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
> prepared to return a reply to every method, if the client requests and
> expects one — otherwise the client will time out. However, that’s a
> much bigger change with a much bigger risk of breaking things, so I’ll
> stick with this for now.
> ---
> gdbus/object.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Patch is still corrupt.
Applying: gdbus: Drop message replies if the sender requested no reply
fatal: corrupt patch at line 10
Patch failed at 0001 gdbus: Drop message replies if the sender requested
no reply
Are you using git send-email?
Regards,
-Denis
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-11 17:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1452297478.3610.4.camel@tecnocode.co.uk>
2016-01-11 17:20 ` [PATCH] gdbus: Drop message replies if the sender requested no reply Denis Kenzior
2015-12-02 15:44 Philip Withnall
2016-01-05 5:36 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2015-12-02 15:36 Philip Withnall
2015-12-04 12:32 ` Luiz Augusto von Dentz
2015-12-02 15:17 Philip Withnall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.