[Xcb] bug #8208: proposed patches

Ian Osgood iano at quirkster.com
Fri Sep 15 07:33:18 PDT 2006


On Sep 15, 2006, at 2:29 AM, Jamey Sharp wrote:

> I chatted further with Bart about bug #8208 the other day, and he  
> argued
> that the "minimal API" for it that I had proposed wasn't actually
> minimal enough. Following his suggestions, I've implemented the  
> function
> XCBConnectionHasError, which returns only a boolean of whether the
> connection is shut down due to some error.

If this is boolean, applies to the connection, and means your  
connection is no longer valid; then how about naming the function  
"XCBDisconnected()"?

> The sequence of patches is attached. Please review.
>
> --Jamey
> <0001-Provide-a-has-error-property-for-XCBConnection.txt>
> <0002-Convert-xcb_conn-functions-to-return-and-accept-error- 
> objects.txt>
> <0003-Make-all-remaining-public-functions-do-nothing-on-an-error- 
> connection.txt>

So the idea is that if XCBConnect() == 1, you can check errno for  
more details?

Shouldn't XCBConnectionHasError() also check for (c==NULL || (int) 
c==1)? In any case, the header comment for XCBConnect() should be  
changed to indicate the function can now return NULL or 1 if there  
are problems.

Also, why return 1 when you could return a connection with has_error  
== 1?  Seems a bit more type-safe.

The XCBPollForEvent() mutex used to protect get_event(), but now only  
protects _xcb_in_read(). Is that OK?

> <0004-Add-a-private-connection-shutdown-method-for-error-cases.txt>
> <0005-Shut-down-the-connection-in-all-fatal-error-cases.txt>

Connection shutdown in XCBSendRequest() if an extension isn't present  
is too harsh, isn't it? Same with exceeding max request length.

> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb



More information about the Xcb mailing list