> 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;
>      }



_______________________________________________
Bug-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Reply via email to