Fix Windows non-blocking HTTP connections and port check warnings - #910
Open
rolling-code wants to merge 5 commits into
Open
Fix Windows non-blocking HTTP connections and port check warnings#910rolling-code wants to merge 5 commits into
rolling-code wants to merge 5 commits into
Conversation
Test for Cloudflare's new MCP JS stuff
Author
|
looks good |
Owner
|
I had a chance to check this out and it looks good. I will get a pre-release branch set up shortly and merge this into it. I'm working a little on my processes to avoid breaking main while doing releases more frequently. |
rolling-code
commented
Aug 17, 2026
rolling-code
left a comment
Author
There was a problem hiding this comment.
Lotus...I'm old enough to remember :-(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix two related connection-handling issues observed with Nikto 2.6.1 on
Windows using Strawberry Perl 5.42.2.
Problems
Nonnumeric port-check result
port_check()returns1for HTTP,2for HTTPS, or a descriptive errorstring. The caller compared the result numerically, causing warnings such as:
Argument "Unable to connect..." isn't numeric in numeric ne (!=)The success values are now compared as strings.
Windows non-blocking connection
On Windows, a pending non-blocking Winsock connection reports
WSAEWOULDBLOCKthrough Perl's native extended error variable$^E.LW2 checked only
$!, causing a normal connection-in-progress state to betreated as a fatal connection error.
The updated connection path:
EINPROGRESSandEWOULDBLOCKselect()getpeername()Environment
d5067406bc0902f8174cb5f8d595f637951974ceValidation
Successful validation:
perl -c program/nikto.plperl program/nikto.pl -dbcheckgit diff --checkA closed local port still fails cleanly without a numeric warning.