… | |
… | |
205 | =cut |
205 | =cut |
206 | |
206 | |
207 | sub parse_hostport($;$) { |
207 | sub parse_hostport($;$) { |
208 | my ($host, $port); |
208 | my ($host, $port); |
209 | |
209 | |
210 | for ("$_[0]") { # work on a copy, to reset pos |
210 | for ("$_[0]") { # work on a copy, just in case, and also reset pos |
211 | |
211 | |
212 | # parse host, special cases: "ipv6" or "ipv6 port" |
212 | # parse host, special cases: "ipv6" or "ipv6 port" |
213 | unless ( |
213 | unless ( |
214 | ($host) = /^\s* ([0-9a-fA-F:]*:[0-9a-fA-F:]*:[0-9a-fA-F\.:]*)/xgc |
214 | ($host) = /^\s* ([0-9a-fA-F:]*:[0-9a-fA-F:]*:[0-9a-fA-F\.:]*)/xgc |
215 | and parse_ipv6 $host |
215 | and parse_ipv6 $host |