[PATCH 1/2 libX11] xcb: Add TCP fallback

Jeremy Huddleston jeremyhu at apple.com
Fri May 14 14:18:21 PDT 2010


On May 14, 2010, at 13:35, Jamey Sharp wrote:

> 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.

The misalignment bothered me, and since I touched the next line, I figured I'd adjust it.

> 
>> +                       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.

Oops, yeah.  I meant to do that and then forgot.

Thanks,
Jeremy



More information about the xorg-devel mailing list