shmpipe: Ref client shmarea when a buffer is received in it

This commit is contained in:
Olivier Crête 2010-01-28 11:31:11 +02:00
parent 68c9ed6e5c
commit 007a26ac08

View file

@ -597,6 +597,7 @@ sp_client_recv (ShmPipe * self, char **buf)
for (area = self->shm_area; area; area = area->next) {
if (area->id == cb.area_id) {
*buf = area->shm_area + cb.payload.buffer.offset;
sp_shm_area_inc (area);
return cb.payload.buffer.size;
}
}
@ -658,6 +659,8 @@ sp_client_recv_finish (ShmPipe * self, char *buf)
offset = buf - shm_area->shm_area;
sp_shm_area_dec (self, shm_area);
cb.payload.ack_buffer.offset = offset;
return send_command (self->main_socket, &cb, COMMAND_ACK_BUFFER,
self->shm_area->id);