Skip to content

Commit

Permalink
Don't attempt to split ports from paths for for UNIX sockets
Browse files Browse the repository at this point in the history
It's possible for a valid path containing a ':' to wind up as something
else if the platform allows colons in filenames like this. Since UNIX
sockets don't use ports in the first place, don't treat them as if they
do.
  • Loading branch information
Kaiepi committed Feb 4, 2020
1 parent 6df78ca commit ce5b5de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.c/IO/Socket/INET.pm6
Expand Up @@ -68,7 +68,7 @@ my class IO::Socket::INET does IO::Socket {

($localhost, $localport) = (
split-host-port :host($localhost), :port($localport), :$family
orelse fail $_);
orelse fail $_) unless $family == nqp::const::SOCKET_FAMILY_UNIX;

#TODO: Learn what protocols map to which socket types and then determine which is needed.
self.bless(
Expand Down Expand Up @@ -97,7 +97,7 @@ my class IO::Socket::INET does IO::Socket {
:$host,
:$port,
:$family,
);
) unless $family == nqp::const::SOCKET_FAMILY_UNIX;

# TODO: Learn what protocols map to which socket types and then determine which is needed.
self.bless(
Expand Down

0 comments on commit ce5b5de

Please sign in to comment.