… | |
… | |
300 | return; |
300 | return; |
301 | } |
301 | } |
302 | } |
302 | } |
303 | |
303 | |
304 | # parse port |
304 | # parse port |
305 | if (/\G (?:\s+|:|#) ([^:[:space:]]+) \s*$/xgc) { |
305 | if (/\G (?:\s+|:|\#) ([^:[:space:]]+) \s*$/xgc) { |
306 | $port = $1; |
306 | $port = $1; |
307 | } elsif (/\G\s*$/gc && length $_[1]) { |
307 | } elsif (/\G\s*$/gc && length $_[1]) { |
308 | $port = $_[1]; |
308 | $port = $_[1]; |
309 | } else { |
309 | } else { |
310 | return; |
310 | return; |
… | |
… | |
491 | $cv->begin; |
491 | $cv->begin; |
492 | |
492 | |
493 | if ($ipv4) { |
493 | if ($ipv4) { |
494 | $cv->begin; |
494 | $cv->begin; |
495 | AnyEvent::DNS::a ($name, sub { |
495 | AnyEvent::DNS::a ($name, sub { |
496 | $res[$ipv4] = [map &parse_ipv4, @_]; |
496 | $res[$ipv4] = [map { parse_ipv4 $_ } @_]; |
497 | $cv->end; |
497 | $cv->end; |
498 | }); |
498 | }); |
499 | }; |
499 | }; |
500 | |
500 | |
501 | if ($ipv6) { |
501 | if ($ipv6) { |
502 | $cv->begin; |
502 | $cv->begin; |
503 | AnyEvent::DNS::aaaa ($name, sub { |
503 | AnyEvent::DNS::aaaa ($name, sub { |
504 | $res[$ipv6] = [map &parse_ipv6, @_]; |
504 | $res[$ipv6] = [map { parse_ipv6 $_ } @_]; |
505 | $cv->end; |
505 | $cv->end; |
506 | }); |
506 | }); |
507 | }; |
507 | }; |
508 | |
508 | |
509 | $cv->end; |
509 | $cv->end; |
… | |
… | |
1013 | $state{to} = AE::timer $timeout, 0, sub { |
1013 | $state{to} = AE::timer $timeout, 0, sub { |
1014 | $! = Errno::ETIMEDOUT; |
1014 | $! = Errno::ETIMEDOUT; |
1015 | $state{next}(); |
1015 | $state{next}(); |
1016 | } if $timeout; |
1016 | } if $timeout; |
1017 | |
1017 | |
1018 | # now connect |
1018 | # now connect |
1019 | if ( |
1019 | if ( |
1020 | (connect $state{fh}, $sockaddr) |
1020 | (connect $state{fh}, $sockaddr) |
1021 | || ($! == Errno::EINPROGRESS # POSIX |
1021 | || ($! == Errno::EINPROGRESS # POSIX |
1022 | || $! == Errno::EWOULDBLOCK |
1022 | || $! == Errno::EWOULDBLOCK |
1023 | # WSAEINPROGRESS intentionally not checked - it means something else entirely |
1023 | # WSAEINPROGRESS intentionally not checked - it means something else entirely |