update github.com/godbus/dbus to latest master (#1305)

* update github.com/godbus/dbus to 271e53dc4968a0f8862f20841cc63bb5f43d6c57

Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
This commit is contained in:
Théo Brigitte 2019-04-03 12:32:48 +02:00 committed by Ben Kochie
parent dbe7badc7c
commit 4d88761c13
8 changed files with 28 additions and 13 deletions

2
go.mod
View file

@ -4,7 +4,7 @@ require (
github.com/beevik/ntp v0.2.0 github.com/beevik/ntp v0.2.0
github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142 github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142
github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7 github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968
github.com/google/go-cmp v0.2.0 // indirect github.com/google/go-cmp v0.2.0 // indirect
github.com/lufia/iostat v0.0.0-20170605150913-9f7362b77ad3 github.com/lufia/iostat v0.0.0-20170605150913-9f7362b77ad3
github.com/mattn/go-xmlrpc v0.0.0-20180914005235-ceecee2c45b7 github.com/mattn/go-xmlrpc v0.0.0-20180914005235-ceecee2c45b7

4
go.sum
View file

@ -16,8 +16,8 @@ github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7/go.mod h1:kXuKAameaga9ci
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f h1:zlOR3rOlPAVvtfuxGKoghCmop5B0TRyu/ZieziZuGiM= github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968 h1:s+PDl6lozQ+dEUtUtQnO7+A2iPG3sK1pI4liU+jxn90=
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=

View file

@ -134,6 +134,8 @@ func SystemBus() (conn *Conn, err error) {
} }
// SystemBusPrivate returns a new private connection to the system bus. // SystemBusPrivate returns a new private connection to the system bus.
// Note: this connection is not ready to use. One must perform Auth and Hello
// on the connection before it is useable.
func SystemBusPrivate(opts ...ConnOption) (*Conn, error) { func SystemBusPrivate(opts ...ConnOption) (*Conn, error) {
return Dial(getSystemBusPlatformAddress(), opts...) return Dial(getSystemBusPlatformAddress(), opts...)
} }
@ -267,7 +269,7 @@ func (conn *Conn) Eavesdrop(ch chan<- *Message) {
conn.eavesdroppedLck.Unlock() conn.eavesdroppedLck.Unlock()
} }
// GetSerial returns an unused serial. // getSerial returns an unused serial.
func (conn *Conn) getSerial() uint32 { func (conn *Conn) getSerial() uint32 {
return conn.serialGen.GetSerial() return conn.serialGen.GetSerial()
} }
@ -381,8 +383,6 @@ func (conn *Conn) Object(dest string, path ObjectPath) BusObject {
return &Object{conn, dest, path} return &Object{conn, dest, path}
} }
// outWorker runs in an own goroutine, encoding and sending messages that are
// sent to conn.out.
func (conn *Conn) sendMessage(msg *Message) { func (conn *Conn) sendMessage(msg *Message) {
conn.sendMessageAndIfClosed(msg, func() {}) conn.sendMessageAndIfClosed(msg, func() {})
} }

View file

@ -189,7 +189,7 @@ func (dec *decoder) decode(s string, depth int) interface{} {
panic(FormatError("input exceeds container depth limit")) panic(FormatError("input exceeds container depth limit"))
} }
length := dec.decode("u", depth).(uint32) length := dec.decode("u", depth).(uint32)
v := reflect.MakeSlice(reflect.SliceOf(typeFor(s[1:])), 0, int(length)) v := reflect.MakeSlice(reflect.SliceOf(typeFor(s[1:])), 0, 0)
// Even for empty arrays, the correct padding must be included // Even for empty arrays, the correct padding must be included
align := alignment(typeFor(s[1:])) align := alignment(typeFor(s[1:]))
if len(s) > 1 && s[1] == '(' { if len(s) > 1 && s[1] == '(' {

View file

@ -263,13 +263,13 @@ func (sh *defaultSignalHandler) DeliverSignal(intf, name string, signal *Signal)
case <-sh.closeChan: case <-sh.closeChan:
return return
default: default:
go func() { go func(ch chan<- *Signal) {
select { select {
case ch <- signal: case ch <- signal:
case <-sh.closeChan: case <-sh.closeChan:
return return
} }
}() }(ch)
} }
} }
} }

View file

@ -16,6 +16,7 @@ type BusObject interface {
AddMatchSignal(iface, member string, options ...MatchOption) *Call AddMatchSignal(iface, member string, options ...MatchOption) *Call
RemoveMatchSignal(iface, member string, options ...MatchOption) *Call RemoveMatchSignal(iface, member string, options ...MatchOption) *Call
GetProperty(p string) (Variant, error) GetProperty(p string) (Variant, error)
SetProperty(p string, v interface{}) error
Destination() string Destination() string
Path() ObjectPath Path() ObjectPath
} }
@ -146,7 +147,7 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch
} }
if msg.Flags&FlagNoReplyExpected == 0 { if msg.Flags&FlagNoReplyExpected == 0 {
if ch == nil { if ch == nil {
ch = make(chan *Call, 10) ch = make(chan *Call, 1)
} else if cap(ch) == 0 { } else if cap(ch) == 0 {
panic("dbus: unbuffered channel passed to (*Object).Go") panic("dbus: unbuffered channel passed to (*Object).Go")
} }
@ -187,7 +188,7 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch
return call return call
} }
// GetProperty calls org.freedesktop.DBus.Properties.GetProperty on the given // GetProperty calls org.freedesktop.DBus.Properties.Get on the given
// object. The property name must be given in interface.member notation. // object. The property name must be given in interface.member notation.
func (o *Object) GetProperty(p string) (Variant, error) { func (o *Object) GetProperty(p string) (Variant, error) {
idx := strings.LastIndex(p, ".") idx := strings.LastIndex(p, ".")
@ -208,6 +209,20 @@ func (o *Object) GetProperty(p string) (Variant, error) {
return result, nil return result, nil
} }
// SetProperty calls org.freedesktop.DBus.Properties.Set on the given
// object. The property name must be given in interface.member notation.
func (o *Object) SetProperty(p string, v interface{}) error {
idx := strings.LastIndex(p, ".")
if idx == -1 || idx+1 == len(p) {
return errors.New("dbus: invalid property " + p)
}
iface := p[:idx]
prop := p[idx+1:]
return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, v).Err
}
// Destination returns the destination that calls on (o *Object) are sent to. // Destination returns the destination that calls on (o *Object) are sent to.
func (o *Object) Destination() string { func (o *Object) Destination() string {
return o.dest return o.dest

View file

@ -203,7 +203,7 @@ func (t *unixTransport) SendMessage(msg *Message) error {
} }
} else { } else {
if err := msg.EncodeTo(t, nativeEndian); err != nil { if err := msg.EncodeTo(t, nativeEndian); err != nil {
return nil return err
} }
} }
return nil return nil

2
vendor/modules.txt vendored
View file

@ -11,7 +11,7 @@ github.com/beorn7/perks/quantile
github.com/coreos/go-systemd/dbus github.com/coreos/go-systemd/dbus
# github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7 # github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7
github.com/ema/qdisc github.com/ema/qdisc
# github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f # github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968
github.com/godbus/dbus github.com/godbus/dbus
# github.com/golang/protobuf v1.2.0 # github.com/golang/protobuf v1.2.0
github.com/golang/protobuf/proto github.com/golang/protobuf/proto