-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make empty_port to look for port on all interfaces by default #45
base: master
Are you sure you want to change the base?
Conversation
I believe that the default value should not be changed from The primary use case of Requiring only the users who need to bind to 0.0.0.0 to explicitly specify the host argument is IMO a better (cautious) approach. |
@kazuho, this thing doesn't change what users of Test-TCP are binding to, therefore it fixes problems for numerous user of Test-TCP which use '0.0.0.0' to bind to in their server code and changes nothing for those who is binding to '127.0.0.1' |
I'm not following what is the purpose of this patch, a few things though:
Correct, but inside
Test::TCP defaults the host to |
Binding to a socket and not accepting any incoming connections is not a security risk at all, as long as you trust your kernel.
It is an easy to make error because the API Fixing this API design flaw requires much more leg work and wait time to ensure wider adoption, than just making slight change in Intermittent test failures happen on our build servers where port found by Out options here is either to go and inspect all test in hundreds of CPAN modules and submit patches to their authors, or submit one line change to Patch is safe, secure, doesn't break any existing code and makes your library to be more robust when used by somebody without full understanding of it's internals. |
I see what you mean saying that '127.0.0.1' is passed to empty_port. I'll provide updated patch soon |
(I see that you see it by now) It definitely defaults to
Right, so I fixed the Plack code instead.
That's a good point and I see no problem in enhancing Test::TCP to pass the host to both callbacks. |
cee14ed
to
49de1a3
Compare
Note that the failed checks are due to TravisCI glitch. @tokuhirom can you go to https://travis-ci.org/tokuhirom/Test-TCP/builds/88768434 and click Restart Job (I don't have privileges)? |
Ok, I have privileges now. Test passed. |
When looking for a port, unless specified which IP to be looking on it should use 0.0.0.0 to be on the safe side.