Browse Source

[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
master
Glenn Strauss 1 year ago
parent
commit
1d9cab1bc3
  1. 2
      src/chunk.c

2
src/chunk.c

@ -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;
}

Loading…
Cancel
Save