[Xcb] 0 sequence number for request errors?
Barton C Massey
bart at cs.pdx.edu
Fri Dec 23 21:37:25 PST 2005
Looks good enough to me! The whole request/req thing in the
one spot was kind of widgy, but OK. Also, I didn't read
this super-carefully.
Thanks for doing this!
Bart
In message <20051224032758.GG7650 at id.minilop.net> you wrote:
>
> --===============0122240111==
> Content-Type: multipart/signed; micalg=pgp-sha1;
> protocol="application/pgp-signature"; boundary="oxV4ZoPwBLqAyY+a"
> Content-Disposition: inline
>
>
> --oxV4ZoPwBLqAyY+a
> Content-Type: multipart/mixed; boundary="e5bfZ/T2xnjpUIbw"
> Content-Disposition: inline
>
>
> --e5bfZ/T2xnjpUIbw
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> On Sat, Dec 17, 2005 at 05:09:55PM -0800, Barton C Massey wrote:
> > One of the biggest holes in current XCB API is that there's
> > no way to find out that a request failed to be sent---in
> > particular, a request that doesn't require a reply.
> >=20
> > One hack to get this behavior would be to "reserve" the
> > sequence number 0 for an error return. IOW, a request that
> > returned a sequence number of 0 has failed. This would
> > require skipping sequence number 0 by issuing a noop inside
> > XCB at this point.
>
> Here's a patch implementing this suggestion. I'm actually quite pleased
> with it: it's not very invasive and existing code magically works
> better. For example, without the patch xcbrandr dies on an assertion
> failure if the server doesn't have the RANDR extension; but with the
> patch, it simply reports "Can't get VersionReply." and exits.
>
> I did change the extension API in this patch. That API is public but at
> present the only code that uses it is inside XCB itself and that's
> autogenerated, so I'm not too concerned about it. Also the change makes
> xproto.o another kilobyte smaller (that's 7%!) on x86 with gcc 3.4.5
> -O3 -- and I assume the extensions got smaller too. So there. ;-)
>
> I haven't yet done the obvious test of making four billion requests and
> ensuring the patched code does the right thing when the sequence number
> wraps.
>
> Question for the list in general and Bart in particular: does this patch
> seem reasonable to you too?
>
> --Jamey
>
> --e5bfZ/T2xnjpUIbw
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="xcb-error-zerosequence.patch"
> Content-Transfer-Encoding: quoted-printable
>
> Index: ChangeLog
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
More information about the Xcb
mailing list