When setting net.inet.tcp.blackhole > 0 on the FreeBSD, spawn-fcgi hangs trying to accomplish the connect syscall on 94'th line of the spawn-fcgi.c:
if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
As I understand, this is a simple check for the port availability which can't be accomplished due to the blackhole option activated. As soon as I deactivate the blackhole option, spawn-fcgi spawns correctly.
I suggest to get rid of this check, because later we call a 'bind' syscall anyway, which also returns error in case if the port is already in use. Why do we do redundant checking ?
Additionally it will also fix the things with the FreeBSD blackhole feature.
Here is a diff for review: www.freebsd.az/other/spawn-fcgi.patch