diff options
| -rwxr-xr-x | test/integration/test-http-if-range | 15 | ||||
| -rw-r--r-- | test/interactive-helper/aptwebserver.cc | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/test/integration/test-http-if-range b/test/integration/test-http-if-range index ca9f3b2e6..462d731cf 100755 --- a/test/integration/test-http-if-range +++ b/test/integration/test-http-if-range @@ -31,7 +31,11 @@ validpartialfile() { head -n 5 "$TESTFILE" > "$DOWNFILE" touch -d "$(stat --format '%y' "${TESTFILE}")" "$DOWNFILE" } -badpartialfile() { +badolderpartialfile() { + head -n 5 "$TESTFILE" > "$DOWNFILE" + touch -d "$(stat --format '%y' "${TESTFILE}") - 1sec" "$DOWNFILE" +} +badnewerpartialfile() { head -n 5 "$TESTFILE" > "$DOWNFILE" touch -d 'now + 1hour' "$DOWNFILE" } @@ -52,8 +56,13 @@ testrun() { testwebserverlaststatuscode "$3" "$DOWNLOADLOG" testsuccess cmp "$TESTFILE" "$DOWNFILE" - badpartialfile - testdownloadfile "bad partial file $1" + badolderpartialfile + testdownloadfile "bad old partial file $1" + testwebserverlaststatuscode "$4" "$DOWNLOADLOG" + testsuccess cmp "$TESTFILE" "$DOWNFILE" + + badnewerpartialfile + testdownloadfile "bad new partial file $1" testwebserverlaststatuscode "$4" "$DOWNLOADLOG" testsuccess cmp "$TESTFILE" "$DOWNFILE" diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 58ba54f84..d4bac24d1 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -828,7 +828,7 @@ static void * handleClient(int const client, size_t const id) /*{{{*/ ifrange = LookupTag(*m, "If-Range", ""); bool validrange = (ifrange.empty() == true || (RFC1123StrToTime(ifrange, cache) == true && - cache <= data.ModificationTime())); + cache == data.ModificationTime())); // FIXME: support multiple byte-ranges (APT clients do not do this) if (condition.find(',') == std::string::npos) |
