summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-06-03 17:21:30 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-06-03 17:21:30 +0200
commite794faae4318fc1d27743e225525e6bf0289edd1 (patch)
tree4d28da9e43ddd580f4dc69f3fef8eb809f2134eb
parent0a93cff4a7cc1ff55480300820ee5ddb74d70d4e (diff)
downloadhittpd-e794faae4318fc1d27743e225525e6bf0289edd1.tar.gz
hittpd-e794faae4318fc1d27743e225525e6bf0289edd1.tar.xz
hittpd-e794faae4318fc1d27743e225525e6bf0289edd1.zip
detect unsatisfiable empty ranges
This fixes wget -c.
-rw-r--r--hittpd.c5
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?