Properly serve empty files
This commit is contained in:
parent
af61e37a3a
commit
9e9facc9bf
1 changed files with 2 additions and 1 deletions
3
quark.c
3
quark.c
|
@ -444,7 +444,8 @@ sendfile(int fd, char *name, struct request *r, struct stat *st, char *mime,
|
|||
"Content-Type: %s\r\n"
|
||||
"Content-Length: %zu\r\n",
|
||||
s, status_str[s], timestamp(time(NULL), t1),
|
||||
timestamp(st->st_mtim.tv_sec, t2), mime, upper - lower + 1) < 0) {
|
||||
timestamp(st->st_mtim.tv_sec, t2), mime,
|
||||
upper - lower + (st->st_size > 0)) < 0) {
|
||||
s = S_REQUEST_TIMEOUT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue