forked from security/hakurei
internal/pipewire: collect non-protocol errors
These errors are recoverable and should not terminate event handling. Only terminate event handling for protocol errors or inconsistent state that makes further event handling impossible. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -94,14 +94,12 @@ type Client struct {
|
||||
Properties SPADict `json:"props"`
|
||||
}
|
||||
|
||||
func (client *Client) consume(opcode byte, files []int, unmarshal func(v any) error) error {
|
||||
if err := closeReceivedFiles(files...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func (client *Client) consume(opcode byte, files []int, unmarshal func(v any)) error {
|
||||
closeReceivedFiles(files...)
|
||||
switch opcode {
|
||||
case PW_CLIENT_EVENT_INFO:
|
||||
return unmarshal(&client.Info)
|
||||
unmarshal(&client.Info)
|
||||
return nil
|
||||
|
||||
default:
|
||||
return &UnsupportedOpcodeError{opcode, client.String()}
|
||||
|
||||
Reference in New Issue
Block a user