proxy: reuse id when server removed it

reset number of fds before we begin reading.
When we destroy the proxy, just clear the id. We then remove the id
completely when the server sends a remove_id request. This avoid
reusing the proxy id before the server has finished with it.
Add some debug
This commit is contained in:
Wim Taymans 2018-03-23 13:29:46 +01:00
parent 41a3a924ef
commit 95d45e4206
4 changed files with 7 additions and 1 deletions

View file

@ -158,6 +158,7 @@ static bool refill_buffer(struct pw_protocol_native_connection *conn, struct buf
buf->buffer_size += len;
/* handle control messages */
buf->n_fds = 0;
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS)
continue;