[Xcb] Is SendRequest missing some padding?

chris at demorecorder.com chris at demorecorder.com
Thu Sep 18 10:27:47 PDT 2014


Hello Alessandro,

I think we should fix the problem in the generator with <pad align="4" />.

Can you please try if <pad align="4" /> works with my newest patches which are not yet merged into upstream?

You can get them with
git clone http://infra-srv1.demorecorder.com/git/free-sw/xcb/libxcb/
git clone http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto/

Regards,

Chris

Alessandro Arzilli wrote on 18.09.2014 14:29:

> Hello,
> X.org X11 protocol documentation specifies that the fields 
> AuthorizationProtocolName and AuthorizationProtocolData should be padded 
> (http://www.x.org/releases/current/doc/xproto/x11protocol.html#Encoding::Connection_Setup),
> 
> xproto.xml however doesn't mention this padding anywhere.
> 
> For context, I found this out because of this: 
> https://github.com/BurntSushi/xgb/issues/24
> I also ran a capture with wireshark and plugged the SetupRequest packet 
> in this program (https://gist.github.com/aarzilli/fcd2a0094f89c29256a9) 
> and it seems that xcb also isn't decoding the padding correctly (but 
> maybe I'm doing it wrong?).
> 
> Also, just adding <pad align="4" /> after the two fields didn't work for 
> me, I just got a compile error with libxcb-1.11.
> This, much uglier, change did work:
> ---
> --- xproto.xml.old	2014-09-18 13:34:17.794910423 +0200
> +++ xproto.xml	2014-09-18 13:54:38.946273390 +0200
> @@ -193,10 +193,28 @@
>      <field type="CARD16" name="authorization_protocol_data_len" />
>      <pad bytes="2" />
>      <list type="char" name="authorization_protocol_name">
> -      <fieldref>authorization_protocol_name_len</fieldref>
> +      <op op="*">
> +        <op op="/">
> +          <op op="+">
> +            <fieldref>authorization_protocol_name_len</fieldref>
> +            <value>3</value>
> +          </op>
> +          <value>4</value>
> +        </op>
> +        <value>4</value>
> +      </op>
>      </list>
>      <list type="char" name="authorization_protocol_data">
> -      <fieldref>authorization_protocol_data_len</fieldref>
> +      <op op="*">
> +        <op op="/">
> +          <op op="+">
> +            <fieldref>authorization_protocol_data_len</fieldref>
> +            <value>3</value>
> +          </op>
> +          <value>4</value>
> +        </op>
> +        <value>4</value>
> +      </op>
>      </list>
>    </struct>
> ---
> 
> Thank you,
> Alessandro Arzilli
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
> 



More information about the Xcb mailing list