[Spice-devel] Question on fill_mask() (server/red_worker.c)

Yaniv Kaul ykaul at redhat.com
Tue Oct 4 04:51:37 PDT 2011


On 10/04/2011 01:25 PM, Yonit Halperin wrote:
> On 10/04/2011 01:20 PM, Alon Levy wrote:
>> On Tue, Oct 04, 2011 at 01:00:47PM +0200, Alon Levy wrote:
>>> On Tue, Oct 04, 2011 at 12:40:21PM +0200, Yaniv Kaul wrote:
>>>> Unless I'm misreading the code (which may very well be), the
>>>> function looks like:
>>>>
>>>> if (mask_bitmap&&  m) {
>>>>      if (this or that) {
>>>>          do X
>>>>          fill_bits(...)
>>>>      } else {
>>>>          fill_bits(...)
>>>>      }
>>>> }
>>>>
>>>> So essentially, if the condition (mask_bitmap&&  m) is NOT met, we
>>>> do not fill the bits. Which means we are sending garbage over the
>>>> wire?
>>>
>>> I read it the same. Can you add the else and see if it gets there? (or
>>> figure that out by just reading the code)
>>>
>>
>> Actually, m should be always non NULL (since it is set unconditionally
>> by spice_marshall_Fill for instance - didn't check the others though) 
>> and I
>> think a marshaller that doesn't get filled will just produce 0 bytes 
>> of output.
>>
> There is no problem with the mask being null. As I recall, we just 
> don't send a mask.

That would have been nice - but how do you tell the client that you did 
not send a mask? From network captures looks like a mask is being sent, 
with garbage in the flag and the point fields and the bitmap being all 
zero'ed (this is what got us to this in the first place). Essentially a 
waste of 12 bytes, if you could signal the client that no need for a 
mask to be sent.
Y.


>>>> Y.
>>>>
>>>> _______________________________________________
>>>> Spice-devel mailing list
>>>> Spice-devel at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>>> _______________________________________________
>>> Spice-devel mailing list
>>> Spice-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



More information about the Spice-devel mailing list