jetzig-framework / jetzig

Jetzig is a web framework written in Zig
MIT License
550 stars 24 forks source link

Fix FD leak in static resource serving #6

Closed Trundle closed 8 months ago

Trundle commented 8 months ago

Currently, jetzig leaks at least one file descriptior per static resource it serves. If the public directory contains subdirectories, it potentially leaks one FD per subdirectory.

To reproduce the issue, either check with lsof (e.g. lsof -c jetzig) after doing some requests or start a jetzig app in a shell with a limit on open files (e.g. run ulimit -n 128 before running the jetzig app).

bobf commented 8 months ago

Looks good ! I will run locally and merge tomorrow. Thank you very much !

bobf commented 8 months ago

I've manually applied these changes on my current feature branch so closing the PR - thank you for finding these bugs !