CVS update: /ccvs/, /ccvs/src/

[email protected] 2 Jun 2005 17:53:03 -0000
Newsgroups gmane.comp.version-control.cvs.cvs
Message-ID <[email protected]>
User: dprice  
Date: 05/06/02 10:53:03

Modified:
 /ccvs/
  ChangeLog, NEWS
 /ccvs/src/
  ChangeLog, sanity.sh, zlib.c

Log:
 Merge changes from 1.11.x.

File Changes:

Directory: /ccvs/
=================

File [changed]: ChangeLog
Url: https://ccvs.cvshome.org/source/browse/ccvs/ChangeLog?r1=1.1222&r2=1.1223
Delta lines:  +4 -0
-------------------
--- ChangeLog	1 Jun 2005 19:33:34 -0000	1.1222
+++ ChangeLog	2 Jun 2005 17:52:59 -0000	1.1223
@@ -1,3 +1,7 @@
+2005-06-02  Derek Price  <[email protected]>
+
+	* NEWS: Note server compression hang fix.
+
 2005-06-01  Derek Price  <[email protected]>
 
 	* TODO (214): Remove completed item.

File [changed]: NEWS
Url: https://ccvs.cvshome.org/source/browse/ccvs/NEWS?r1=1.320&r2=1.321
Delta lines:  +3 -0
-------------------
--- NEWS	27 May 2005 18:07:47 -0000	1.320
+++ NEWS	2 Jun 2005 17:52:59 -0000	1.321
@@ -23,6 +23,9 @@
 
 BUG FIXES
 
+* A problem where the server could block indefinitely waiting for an EOF from
+  the client when compression was enabled has ben fixed.
+
 * `cvs diff' no longer splits its arguments on spaces.
 
 * Thanks to an old report and patch from Stewart Brodie <[email protected]>, a

Directory: /ccvs/src/
=====================

File [changed]: ChangeLog
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/ChangeLog?r1=1.3203&r2=1.3204
Delta lines:  +8 -0
-------------------
--- ChangeLog	1 Jun 2005 01:42:35 -0000	1.3203
+++ ChangeLog	2 Jun 2005 17:53:00 -0000	1.3204
@@ -1,3 +1,11 @@
+2005-06-02  Derek Price  <[email protected]>
+
+	* zlib.c (compress_buffer_input): Don't request more bytes from the
+	underlying buffer than asked for.
+	(compress_buffer_shutdown_input): Don't attempt to read EOF from the
+	client during shutdown.  It might never be sent.
+	* sanity.sh (abspath2): Test for this.
+
 2005-05-31  Derek Price  <[email protected]>
 
 	* rcscmds.c (call_diff_argc_allocated): Rename to...

File [changed]: sanity.sh
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/sanity.sh?r1=1.1065&r2=1.1066
Delta lines:  +5 -1
-------------------
--- sanity.sh	27 May 2005 18:07:48 -0000	1.1065
+++ sanity.sh	2 Jun 2005 17:53:00 -0000	1.1066
@@ -15267,7 +15267,11 @@
 	  # cvs checkout: warning: cannot make directory CVS in /: Permission denied
 	  # cvs [checkout aborted]: cannot make directory /foo: Permission denied
 	  # $
-	  dotest_fail abspath2-1 "${testcvs} co /foo" \
+	  #
+	  # The -z9 in this test also checks for an old server bug where the
+	  # server would block indefinitely attempting to read an EOF from the
+	  # client in the compression buffer shutdown routine.
+	  dotest_fail abspath2-1 "$testcvs -z9 co /foo" \
 "$CPROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
 "$SPROG \[server aborted\]: Absolute module reference invalid: \`/foo'
 $CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"

File [changed]: zlib.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/zlib.c?r1=1.28&r2=1.29
Delta lines:  +5 -15
--------------------
--- zlib.c	10 Mar 2005 16:29:16 -0000	1.28
+++ zlib.c	2 Jun 2005 17:53:00 -0000	1.29
@@ -227,8 +227,7 @@
 	   would fetch all the available bytes, and at least one byte.  */
 
 	status = (*cb->buf->input) (cb->buf->closure, bd->text,
-				    need > 0 ? 1 : 0,
-				    BUFFER_DATA_SIZE, &nread);
+				    need, BUFFER_DATA_SIZE, &nread);
 
 	if (status == -2)
 	    /* Don't try to recover from memory allcoation errors.  */
@@ -399,19 +398,10 @@
     struct compress_buffer *cb = buf->closure;
     int zstatus;
 
-    /* Pick up any trailing data, such as the checksum.  */
-    while (1)
-    {
-	int status;
-	size_t nread;
-	char buf[100];
-
-	status = compress_buffer_input (cb, buf, 0, sizeof buf, &nread);
-	if (status == -1)
-	    break;
-	if (status != 0)
-	    return status;
-    }
+    /* Don't make any attempt to pick up trailing data since we are shutting
+     * down.  If the client doesn't know we are shutting down, we might not
+     * see the EOF we are expecting.
+     */
 
     zstatus = inflateEnd (&cb->zstr);
     if (zstatus != Z_OK)