Closed vividsnow closed 4 years ago
Hi @vividsnow ! Thanks for the PR! I haven't used or tested this module for years. The patch looks small so perhaps you can just walk me through it? Or, if we have a mutual friend, can you have them vouch for you and I'll just give you merge permission?
I am not sure why the socket file is getting unlinked if it exists (unlink $listen if -S $listen;
) ... doesn't this cause a race condition between unlinking and opening it via IO::Socket::UNIX
? Also, doesn't calling umask(0)
make the file mode rwx
by everyone? Would it be simpler, and less prone to race and permission issues, to just let IO::Socket::UNIX->new
fail if permission isn't right?
Nice to have: if you could make the code the same as the IO::Socket::INET
constructor below, that would be ideal.
s/to just let/to not unlink and just let/
Or I suppose we can wait for @audreyt to take a look (thank you so much for looking after Feersum!)
Hi, @stash @audreyt
I fixed code style, but passing 'Blocking => 0' is currently unsupported by IO::Socket::UNIX, which is presumably a bug https://github.com/Perl/perl5/pull/17787
This looks good to me. Would it be possible to write a unit test in t/
?
Yes, it will be feasible by using Test::SharedFork
support listening on unix socket, so one can run:
plackup -E production -l /tmp/app.sock -s Feersum --pre-fork N app.psgi
orfeersum --native --listen /tmp/app.sock --pre-fork N ./app.feersum