diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2016-04-26 09:25:09 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2016-04-26 09:25:09 -0400 |
commit | 48fe5d6c1f586f6a77ff68e50c78fbe8dda8a21b (patch) | |
tree | 6e1cbfd3f6279048e77b01ae07ce0cd27f07ca45 /WWW/Library | |
parent | e0c4451eeee7b46526c2bb3060e388dc6c0f0d29 (diff) | |
download | lynx-snapshots-48fe5d6c1f586f6a77ff68e50c78fbe8dda8a21b.tar.gz |
snapshot of project "lynx", label v2-8-9dev_8d
Diffstat (limited to 'WWW/Library')
-rw-r--r-- | WWW/Library/Implementation/HTFormat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index f17cb947..54850418 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFormat.c,v 1.83 2014/07/24 22:08:24 tom Exp $ + * $LynxId: HTFormat.c,v 1.84 2016/04/26 09:11:03 tom Exp $ * * Manage different file formats HTFormat.c * ============================= @@ -776,7 +776,6 @@ int HTCopy(HTParentAnchor *anchor, #else status = NETREAD(file_number, input_buffer, INPUT_BUFFER_SIZE); #endif /* USE_SSL */ - if (status <= 0) { if (status == 0) { break; @@ -880,6 +879,11 @@ int HTCopy(HTParentAnchor *anchor, HTReadProgress(bytes, limit); HTDisplayPartial(); + /* 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) + break; } /* next bufferload */ if (anchor != 0) { CTRACE((tfp, "HTCopy copied %" |