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: Derek Price
Subject: Re: Windows CVS 1.12.12.1 Latest + Patch - "version" Command HangsBut :pserver: Not Busy
Date: Sat, 24 Sep 2005 20:04:09 -0400
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Conrad T. Pino wrote:

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

I committed the attached instead.  Does it work for you?

Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot <http://ximbiot.com>
v: +1 717.579.6168
f: +1 717.234.3125
<mailto:address@hidden>

Index: src/socket-client.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/socket-client.c,v
retrieving revision 1.16
diff -u -p -r1.16 socket-client.c
--- src/socket-client.c 24 Sep 2005 23:57:02 -0000      1.16
+++ src/socket-client.c 25 Sep 2005 00:01:00 -0000
@@ -91,6 +91,8 @@ socket_buffer_input (void *closure, char
        blocking mode normally waits until all the requested data is
        available.  */
 
+    assert (size >= need);
+
     *got = 0;
 
     do
@@ -106,7 +108,7 @@ socket_buffer_input (void *closure, char
           makes sure that we only recv() BUFFER_DATA_SIZE bytes at
           a time.  */
 
-       nbytes = recv (sb->socket, data, size, 0);
+       nbytes = recv (sb->socket, data + *got, size - *got, 0);
        if (nbytes < 0)
            error (1, 0, "reading from server: %s",
                   SOCK_STRERROR (SOCK_ERRNO));
@@ -121,12 +123,9 @@ socket_buffer_input (void *closure, char
            else
                return 0;
        }
-       need -= nbytes;
-       size -= nbytes;
-       data += nbytes;
        *got += nbytes;
     }
-    while (need > 0);
+    while (*got < need);
 
     return 0;
 }

reply via email to

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