[Spice-devel] [server PATCH 1/8] red_worker: use only RCC_FOREACH_SAFE

Uri Lublin uril at redhat.com
Tue Jul 9 08:40:46 PDT 2013


On 07/08/2013 06:42 PM, Yonit Halperin wrote:
> Hi,
>
> On 07/08/2013 06:32 AM, Uri Lublin wrote:
>> RCC_FOREACH may be dangerous
>>
>> The following patches replace FOREACH loops with a SAFE version.
>> Using unsafe loops may cause spice-server to abort (assert fails).
>> Specifically a read/write fail in those loops, may cause the client
>> to disconnect, removing the node currently iterated, which cause spice
>> to abort in ring_next():
>>   -- assertion `pos->next != NULL && pos->prev != NULL' failed
> Now that red_channel was fixed to use RING_FOREACH_SAFE where needed, 
> I think it would be nicer to reuse red_channel.c code, specifically, 
> red_channel_pipes_new_add.

Hi Yonit,

Thanks for the review.

It's possible to reuse red_channel.c code.
I'm not sure it would make the code more readable with the
callbacks, but possibly easier to debug.

Thanks,
     Uri.



More information about the Spice-devel mailing list