[PATCH 5/7] os: Hide the Connection{In, Out}put implementation details

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 11 19:12:07 PST 2012


This one introduces a regression for me.
Firefox hangs if tabs are opened or closed, and Thunderbird tends to lock up
the whole shell. Doesn't always happen immediately, but usually within 3
tabs being opened/closed. 

The server itself doesn't hang, it's still in WaitForSomething(), merely all
rendering stops.

git bisect pointed me to this commit twice (didn't believe it the first
time) and with it reverted, master behaves normally again. Input and video
drivers were recompiled each bisect stage.

Cheers,
  Peter

On Fri, Jun 17, 2011 at 02:36:35PM -0400, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  os/connection.c |    2 +-
>  os/io.c         |   19 ++++++++++++++++++-
>  os/osdep.h      |   18 ++----------------
>  3 files changed, 21 insertions(+), 18 deletions(-)
> 
> diff --git a/os/connection.c b/os/connection.c
> index dd7b066..527d4e4 100644
> --- a/os/connection.c
> +++ b/os/connection.c
> @@ -1031,7 +1031,7 @@ CloseDownConnection(ClientPtr client)
>      if (FlushCallback)
>  	CallCallbacks(&FlushCallback, NULL);
>  
> -    if (oc->output && oc->output->count)
> +    if (oc->output)
>  	FlushClient(client, oc, (char *)NULL, 0);
>  #ifdef XDMCP
>      XdmcpCloseDisplay(oc->fd);
> diff --git a/os/io.c b/os/io.c
> index 4210238..1c161da 100644
> --- a/os/io.c
> +++ b/os/io.c
> @@ -84,6 +84,23 @@ SOFTWARE.
>  CallbackListPtr       ReplyCallback;
>  CallbackListPtr       FlushCallback;
>  
> +typedef struct _connectionInput {
> +    struct _connectionInput *next;
> +    char *buffer;               /* contains current client input */
> +    char *bufptr;               /* pointer to current start of data */
> +    int  bufcnt;                /* count of bytes in buffer */
> +    int lenLastReq;
> +    int size;
> +    unsigned int ignoreBytes;   /* bytes to ignore before the next request */
> +} ConnectionInput, *ConnectionInputPtr;
> +
> +typedef struct _connectionOutput {
> +    struct _connectionOutput *next;
> +    unsigned char *buf;
> +    int size;
> +    int count;
> +} ConnectionOutput, *ConnectionOutputPtr;
> +
>  static ConnectionInputPtr AllocateInputBuffer(void);
>  static ConnectionOutputPtr AllocateOutputBuffer(void);
>  
> @@ -890,7 +907,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
>      long notWritten;
>      long todo;
>  
> -    if (!oco)
> +    if (!oco || !oco->count)
>  	return 0;
>      written = 0;
>      padsize = padlength[extraCount & 3];
> diff --git a/os/osdep.h b/os/osdep.h
> index 34a4b1e..d148959 100644
> --- a/os/osdep.h
> +++ b/os/osdep.h
> @@ -118,22 +118,8 @@ typedef Bool (*AddAuthorFunc)(unsigned name_length, const char *name,
>  			      unsigned data_length, char *data);
>  #endif
>  
> -typedef struct _connectionInput {
> -    struct _connectionInput *next;
> -    char *buffer;               /* contains current client input */
> -    char *bufptr;               /* pointer to current start of data */
> -    int  bufcnt;                /* count of bytes in buffer */
> -    int lenLastReq;
> -    int size;
> -    unsigned int ignoreBytes;   /* bytes to ignore before the next request */
> -} ConnectionInput, *ConnectionInputPtr;
> -
> -typedef struct _connectionOutput {
> -    struct _connectionOutput *next;
> -    unsigned char *buf;
> -    int size;
> -    int count;
> -} ConnectionOutput, *ConnectionOutputPtr;
> +typedef struct _connectionInput *ConnectionInputPtr;
> +typedef struct _connectionOutput *ConnectionOutputPtr;
>  
>  struct _osComm;
>  
> -- 
> 1.7.5.4


More information about the xorg-devel mailing list