From c94d559bc3a2f193fb6ac3a0d78cf9f7ce40fdae Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Mon, 16 Jun 2008 21:49:15 -0700 Subject: [PATCH] Don't abort when len > contlen, when we set it that way. --- src/ChangeLog | 6 ++++++ src/http.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index ae04028d..deee0232 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2008-06-16 Micah Cowan + + * http.c (http_loop): When hstat.len is higher than the + successfully completed content's length, but it's because we + _set_ it that way, don't abort. + 2008-06-13 Micah Cowan * build_info.c: ENABLE_NTLM, not HAVE_NTLM; distinguish OpenSSL diff --git a/src/http.c b/src/http.c index 919d7593..78e57373 100644 --- a/src/http.c +++ b/src/http.c @@ -2800,10 +2800,18 @@ Remote file exists.\n\n")); printwhat (count, opt.ntry); continue; } - else + else if (hstat.len != hstat.restval) /* Getting here would mean reading more data than requested with content-length, which we never do. */ abort (); + else + { + /* Getting here probably means that the content-length was + * _less_ than the original, local size. We should probably + * truncate or re-read, or something. FIXME */ + ret = RETROK; + goto exit; + } } else /* from now on hstat.res can only be -1 */ { -- 2.39.2