policy-node: destroy node only after sending an error to the client
if the node is destroyed before, pw_stream shuts down and doesn't relay the error to the application
This commit is contained in:
@@ -770,10 +770,7 @@ function handleLinkable (si)
|
|||||||
Log.info (si, "... target not found, reconnect:" .. tostring(reconnect))
|
Log.info (si, "... target not found, reconnect:" .. tostring(reconnect))
|
||||||
|
|
||||||
local node = si:get_associated_proxy ("node")
|
local node = si:get_associated_proxy ("node")
|
||||||
if not reconnect then
|
if reconnect and si_flags[si.id].was_handled then
|
||||||
Log.info (si, "... destroy node")
|
|
||||||
node:request_destroy()
|
|
||||||
elseif si_flags[si.id].was_handled then
|
|
||||||
Log.info (si, "... waiting reconnect")
|
Log.info (si, "... waiting reconnect")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -783,9 +780,20 @@ function handleLinkable (si)
|
|||||||
local client = clients_om:lookup {
|
local client = clients_om:lookup {
|
||||||
Constraint { "bound-id", "=", client_id, type = "gobject" }
|
Constraint { "bound-id", "=", client_id, type = "gobject" }
|
||||||
}
|
}
|
||||||
if client then
|
local message
|
||||||
client:send_error(node["bound-id"], -2, "no node available")
|
if reconnect then
|
||||||
|
message = "no target node available"
|
||||||
|
else
|
||||||
|
message = "target not found"
|
||||||
end
|
end
|
||||||
|
if client then
|
||||||
|
client:send_error(node["bound-id"], -2, message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if not reconnect then
|
||||||
|
Log.info (si, "... destroy node")
|
||||||
|
node:request_destroy()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
createLink (si, si_target, can_passthrough, exclusive)
|
createLink (si, si_target, can_passthrough, exclusive)
|
||||||
|
Reference in New Issue
Block a user