[Xcb] [PATCH 1/2 libX11] xcb: Add TCP fallback
Jamey Sharp
jamey at minilop.net
Fri May 14 13:35:56 PDT 2010
This patch looks fine to me:
Reviewed-by: Jamey Sharp <jamey at minilop.net>
I have some nitpicks and suggestions though. The big suggestion is
that it seems like it should be easier to write this loop in
_XConnectXCB instead of directly in OpenDisplay. For the nitpicks:
On Fri, May 14, 2010 at 1:10 PM, Jeremy Huddleston <jeremyhu at apple.com> wrote:
> - long int conn_buf_size;
> - char *xlib_buffer_size;
> + long int conn_buf_size;
> + char *xlib_buffer_size;
There doesn't seem to have been a reason to touch these.
> + if(!buf) {
> + dpy->display_name = fullname;
> + OutOfMemory(dpy, NULL);
> + return NULL;
> + }
> +
> + for(s = protocols; *s; s++) {
> + snprintf(buf, buf_size, "%s/%s", *s, display_name);
> + if(_XConnectXCB(dpy, buf, &fullname, &iscreen))
> + goto fallback_success;
> + }
> + }
> +
> dpy->display_name = fullname;
> OutOfMemory(dpy, NULL);
> return NULL;
> }
> +fallback_success:
You can eliminate the extra OutOfMemory block by wrapping the for loop
in "if(buf)", instead of having an "if(!buf)" check.
Jamey
More information about the Xcb
mailing list