Skip to content

Commit 7b18980

Browse files
committed
Handle port-less sockets in parser
Fixes #6.
1 parent fe0ab29 commit 7b18980

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/reloadedvibes/utils.d

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ bool tryParseSocket(string s, out Socket socket)
7070

7171
isIPv6 = s.indexOf(':', ipv6end);
7272
}
73-
else
73+
else if (possiblePortSep > -1)
7474
{
75+
// IPv4
7576
socket.address = s[0 .. possiblePortSep];
7677
}
78+
else
79+
{
80+
return false;
81+
}
7782

7883
immutable portSep = (isIPv6) ? isIPv6 : possiblePortSep;
7984
string port = s[(portSep + 1) .. $];

0 commit comments

Comments
 (0)