diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2017-07-02 17:15:14 +0000 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2017-07-02 17:15:14 +0000 |
commit | 5600928a5398f5f67b7e0915021dddf3e56acc74 (patch) | |
tree | 119684d1b24a52b9b422d5af14d93c62e2e4ed6a /WWW/Library | |
parent | ef95d3394d7eee525660f6111a335670646a9876 (diff) | |
download | lynx-snapshots-5600928a5398f5f67b7e0915021dddf3e56acc74.tar.gz |
snapshot of project "lynx", label v2-8-9dev_14d
Diffstat (limited to 'WWW/Library')
-rw-r--r-- | WWW/Library/Implementation/HTFormat.c | 16 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTMIME.c | 5 |
2 files changed, 8 insertions, 13 deletions
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", |