about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2017-07-02 17:15:14 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2017-07-02 17:15:14 +0000
commit5600928a5398f5f67b7e0915021dddf3e56acc74 (patch)
tree119684d1b24a52b9b422d5af14d93c62e2e4ed6a
parentef95d3394d7eee525660f6111a335670646a9876 (diff)
downloadlynx-snapshots-5600928a5398f5f67b7e0915021dddf3e56acc74.tar.gz
snapshot of project "lynx", label v2-8-9dev_14d
-rw-r--r--CHANGES5
-rw-r--r--WWW/Library/Implementation/HTFormat.c16
-rw-r--r--WWW/Library/Implementation/HTMIME.c5
3 files changed, 11 insertions, 15 deletions
diff --git a/CHANGES b/CHANGES
index 9a1d25a6..c59e6f3f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,10 @@
--- $LynxId: CHANGES,v 1.898 2017/06/21 21:05:32 tom Exp $
+-- $LynxId: CHANGES,v 1.899 2017/07/02 17:15:14 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
-2017-06-21 (2.8.9dev.15)
+2017-07-02 (2.8.9dev.15)
+* correct logic in HTCopy() when re-reading a page (Debian #863008) -TD
 * fix lintian warnings in ".deb" test-package -TD
 * build-fix for PGI compilers, e.g., symbol conflicts -TD
 * update eo.po from
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index 1ba5f199..ccab7d89 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTFormat.c,v 1.85 2016/11/24 15:29:50 tom Exp $
+ * $LynxId: HTFormat.c,v 1.86 2017/07/02 17:09:45 tom Exp $
  *
  *		Manage different file formats			HTFormat.c
  *		=============================
@@ -732,8 +732,7 @@ int HTCopy(HTParentAnchor *anchor,
     HTStreamClass targetClass;
     BOOL suppress_readprogress = NO;
     off_t limit = anchor ? anchor->content_length : 0;
-    off_t bytes = anchor ? anchor->actual_length : 0;
-    off_t total;
+    off_t bytes = 0;
     int rv = 0;
 
     /*  Push the data down the stream
@@ -865,13 +864,8 @@ int HTCopy(HTParentAnchor *anchor,
 	}
 #endif /* NOT_ASCII */
 
-	total = bytes + status;
-	if (limit == 0 || bytes == 0 || (total < limit)) {
-	    (*targetClass.put_block) (sink, input_buffer, status);
-	} else if (bytes < limit) {
-	    (*targetClass.put_block) (sink, input_buffer, (int) (limit - bytes));
-	}
-	bytes = total;
+	(*targetClass.put_block) (sink, input_buffer, status);
+	bytes += status;
 	if (!suppress_readprogress)
 	    HTReadProgress(bytes, limit);
 	HTDisplayPartial();
@@ -879,7 +873,7 @@ int HTCopy(HTParentAnchor *anchor,
 	/* a few buggy implementations do not close the connection properly
 	 * and will hang if we try to read past the declared content-length.
 	 */
-	if (limit > 0 && bytes == limit)
+	if (limit > 0 && bytes >= limit)
 	    break;
     }				/* next bufferload */
     if (anchor != 0) {
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index 909fbb5e..2014e459 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTMIME.c,v 1.93 2017/02/10 22:27:42 tom Exp $
+ * $LynxId: HTMIME.c,v 1.94 2017/07/02 16:49:21 tom Exp $
  *
  *			MIME Message Parse			HTMIME.c
  *			==================
@@ -2047,7 +2047,8 @@ static void HTMIME_put_character(HTStream *me, int c)
     HTChunkPutc(&me->anchor->http_headers, UCH(c));
     if (me->state == MIME_TRANSPARENT) {
 	HTChunkTerminate(&me->anchor->http_headers);
-	CTRACE((tfp, "Server Headers:\n%.*s\n",
+	CTRACE((tfp, "Server Headers (%d bytes):\n%.*s\n",
+		me->anchor->http_headers.size,
 		me->anchor->http_headers.size,
 		me->anchor->http_headers.data));
 	CTRACE((tfp, "Server Content-Type:%s\n",
lass="n">tests = [] for key, val in vars().copy().items(): if key.startswith('tc_'): tests.extend(v for k,v in vars(val).items() if type(v) == type) suite = unittest.TestSuite(map(unittest.makeSuite, tests)) unittest.TextTestRunner(verbosity=2).run(suite)