[core] always set file.fd = -1 on FILE_CHUNK reset (fixes #3044)

(thx flynn)

x-ref:
  "Socket errors after update to version 1.4.56"
  https://redmine.lighttpd.net/issues/3044
This commit is contained in:
Glenn Strauss 2020-12-09 05:02:43 -05:00
parent d15e2286f2
commit 1d9cab1bc3
1 changed files with 1 additions and 1 deletions

View File

@ -107,13 +107,13 @@ static void chunk_reset_file_chunk(chunk *c) {
}
else if (c->file.fd != -1) {
close(c->file.fd);
c->file.fd = -1;
}
if (MAP_FAILED != c->file.mmap.start) {
munmap(c->file.mmap.start, c->file.mmap.length);
c->file.mmap.start = MAP_FAILED;
c->file.mmap.length = c->file.mmap.offset = 0;
}
c->file.fd = -1;
c->file.length = 0;
c->type = MEM_CHUNK;
}