bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Windows CVS 1.12.12.1 Latest + Patch - "version" Command HangsBut :p


From: Conrad T. Pino
Subject: RE: Windows CVS 1.12.12.1 Latest + Patch - "version" Command HangsBut :pserver: Not Busy
Date: Sat, 24 Sep 2005 15:58:42 -0700

> From: Conrad T. Pino
 
This patch stops the hang with :pserver: for version, status & update
commands.  See notes below.

> Index: src/socket-client.c
> ===================================================================
> RCS file: /cvsroot/cvs/ccvs/src/socket-client.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 socket-client.c
> --- src/socket-client.c       26 May 2005 08:24:17 -0000      1.15
> +++ src/socket-client.c       24 Sep 2005 22:15:02 -0000
> @@ -143,8 +143,16 @@ socket_buffer_input( void *closure, char
>           else
>               return 0;
>       }
> -     need -= nbytes;
> -     size -= nbytes;
> +     if (nbytes < need)
> +             need -= nbytes;
> +     else
> +             need = 0;

IMO the above stops the loop appropriately.

My concern is the "extra" data important?

> +     if (nbytes < size)
> +             size -= nbytes;
> +     else
> +             size = 0;

This part is not needed if the "recv" function *never* returns a value
greater than it's "size" argument.

Can we trust "recv" function on *all* platforms to do so?

>       data += nbytes;
>       *got += nbytes;
>      }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]