Open Source Telephony
 help / color / mirror / Atom feed
* [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; 3+ 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] 3+ 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; 3+ 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] 3+ 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; 3+ 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] 3+ messages in thread

end of thread, other threads:[~2016-01-11 17:20 UTC | newest]

Thread overview: 3+ 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

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