mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
protocol-native: do version check on HELLO
Always do the version check on HELLO because the connection could have been moved from a v3 portal to a v0 client (like chrome) Fixes #270
This commit is contained in:
parent
16872549e3
commit
b8c7b36d3b
1 changed files with 1 additions and 3 deletions
|
|
@ -72,7 +72,6 @@ struct impl {
|
|||
|
||||
uint32_t version;
|
||||
size_t hdr_size;
|
||||
unsigned int checked:1;
|
||||
};
|
||||
|
||||
/** \endcond */
|
||||
|
|
@ -319,7 +318,7 @@ static int prepare_packet(struct pw_protocol_native_connection *conn, struct buf
|
|||
buf->msg.opcode = p[1] >> 24;
|
||||
len = p[1] & 0xffffff;
|
||||
|
||||
if (!impl->checked) {
|
||||
if (buf->msg.id == 0 && buf->msg.opcode == 1) {
|
||||
if (p[3] >= 4) {
|
||||
pw_log_warn("old version detected");
|
||||
impl->version = 0;
|
||||
|
|
@ -331,7 +330,6 @@ static int prepare_packet(struct pw_protocol_native_connection *conn, struct buf
|
|||
spa_hook_list_call(&conn->listener_list,
|
||||
struct pw_protocol_native_connection_events,
|
||||
start, 0, impl->version);
|
||||
impl->checked = 1;
|
||||
}
|
||||
if (impl->version >= 3) {
|
||||
buf->msg.seq = p[2];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue