mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-07 11:55:10 +00:00
server: avoid unneeded recursion in dispatch_vdi_port_data
dispatch_vdi_port_data, was calling vdi_read_buf_release when no client is connected to free the passed in buf. The only difference between vdi_read_buf_release and directly adding the buffer back to the ring with ring_add, is that vdi_read_buf_release calls read_from_vdi_port after adding the buffer back. But dispatch_vdi_port_data only gets called from read_from_vdi_port itself, thus this would lead to recursing into read_from_vdi_port. read_from_vdi_port is protected against recursion and will immediately return if called recursively. Thus calling vdi_read_buf_release from dispatch_vdi_port_data is pointless, instead simply putting the buffer back in the ring suffices.
This commit is contained in:
parent
bcf9a60aa9
commit
c231417393
@ -833,7 +833,7 @@ static void dispatch_vdi_port_data(int port, VDIReadBuf *buf)
|
||||
vdi_read_buf_release, buf);
|
||||
} else {
|
||||
red_printf("throwing away, no client: %d", buf->len);
|
||||
vdi_read_buf_release(buf->data, buf);
|
||||
ring_add(&state->read_bufs, &buf->link);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user