diff options
author | Leah Neukirchen <leah@vuxu.org> | 2021-06-03 17:21:30 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2021-06-03 17:21:30 +0200 |
commit | e794faae4318fc1d27743e225525e6bf0289edd1 (patch) | |
tree | 4d28da9e43ddd580f4dc69f3fef8eb809f2134eb | |
parent | 0a93cff4a7cc1ff55480300820ee5ddb74d70d4e (diff) | |
download | hittpd-e794faae4318fc1d27743e225525e6bf0289edd1.tar.gz hittpd-e794faae4318fc1d27743e225525e6bf0289edd1.tar.xz hittpd-e794faae4318fc1d27743e225525e6bf0289edd1.zip |
detect unsatisfiable empty ranges
This fixes wget -c.
-rw-r--r-- | hittpd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hittpd.c b/hittpd.c index 53e747d..26f628c 100644 --- a/hittpd.c +++ b/hittpd.c @@ -731,6 +731,11 @@ file: if (data->last > st.st_size) data->last = st.st_size; + if (data->first == data->last) { + send_rns(p, st.st_size); + return 0; + } + send_ok(p, st.st_mtime, mimetype(ext), st.st_size); // XXX send short file directly? |