From e794faae4318fc1d27743e225525e6bf0289edd1 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 3 Jun 2021 17:21:30 +0200 Subject: detect unsatisfiable empty ranges This fixes wget -c. --- hittpd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hittpd.c') 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? -- cgit 1.4.1