all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Hugh Daschbach <hugh@ccss.com>
Cc: 43146@debbugs.gnu.org
Subject: bug#43146: 27.1; D-Bus property handling incomplete
Date: Wed, 02 Sep 2020 19:58:36 +0200	[thread overview]
Message-ID: <87zh68hxgz.fsf@gmx.de> (raw)
In-Reply-To: <873642mfxd.fsf@ccss.com> (Hugh Daschbach's message of "Mon, 31 Aug 2020 18:41:50 -0700")

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

Hugh Daschbach <hugh@ccss.com> writes:

Hi Hugh,

> When the same D-Bus property is registered on an interface with two
> separate paths, only the last property is preserved.  Methods and
> signals registered on the same interface on different paths are
> preserved.

I could reproduce the bug locally. The following patch solves it for me,
could you pls check?

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2359 bytes --]

*** /tmp/ediffkDjiXo	2020-09-02 19:51:41.334910903 +0200
--- /home/albinus/src/emacs/lisp/net/dbus.el	2020-09-02 19:40:00.173649689 +0200
***************
*** 1484,1498 ****

    ;; Create a hash table entry.  We use nil for the unique name,
    ;; because the property might be accessed from anybody.
!   (let ((key (list :property bus interface property))
! 	(val
! 	 (list
  	  (list
  	   nil service path
  	   (cons
  	    (if emits-signal (list access :emits-signal) (list access))
! 	    value)))))
!     (puthash key val dbus-registered-objects-table)

      ;; Return the object.
      (list key (list service path))))
--- 1484,1502 ----

    ;; Create a hash table entry.  We use nil for the unique name,
    ;; because the property might be accessed from anybody.
!   (let* ((key (list :property bus interface property))
!          ;; Remove possible existing entry, because it must be overwritten.
!          (val (seq-remove
!                (lambda (item)
!                  (equal (butlast item) (list nil service path)))
!                (gethash key dbus-registered-objects-table)))
! 	 (entry
  	  (list
  	   nil service path
  	   (cons
  	    (if emits-signal (list access :emits-signal) (list access))
! 	    value))))
!     (puthash key (cons entry val) dbus-registered-objects-table)

      ;; Return the object.
      (list key (list service path))))
***************
*** 1509,1517 ****
      (cond
       ;; "Get" returns a variant.
       ((string-equal method "Get")
!       (let ((entry (gethash (list :property bus interface property)
! 			    dbus-registered-objects-table)))
! 	(when (string-equal path (nth 2 (car entry)))
  	  `((:variant ,(cdar (last (car entry))))))))

       ;; "Set" expects a variant.
--- 1513,1527 ----
      (cond
       ;; "Get" returns a variant.
       ((string-equal method "Get")
!       (let ((entry
!              ;; Remove entries not belonging to this case.
!              (seq-remove
!               (lambda (item)
!                 (not (string-equal path (nth 2 item))))
!               (gethash (list :property bus interface property)
! 		       dbus-registered-objects-table))))
!
!         (when (string-equal path (nth 2 (car entry)))
  	  `((:variant ,(cdar (last (car entry))))))))

       ;; "Set" expects a variant.

  reply	other threads:[~2020-09-02 17:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  1:41 bug#43146: 27.1; D-Bus property handling incomplete Hugh Daschbach
2020-09-02 17:58 ` Michael Albinus [this message]
2020-09-02 19:01   ` Hugh Daschbach
2020-09-02 22:01     ` Hugh Daschbach
2020-09-03 11:52       ` Michael Albinus
2020-09-03 18:23         ` Hugh Daschbach
2020-09-03 18:57           ` Michael Albinus
2020-09-03  6:50     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh68hxgz.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=43146@debbugs.gnu.org \
    --cc=hugh@ccss.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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.