… | |
… | |
705 | our @ISA; |
705 | our @ISA; |
706 | |
706 | |
707 | our $verbose = $ENV{PERL_ANYEVENT_VERBOSE}*1; |
707 | our $verbose = $ENV{PERL_ANYEVENT_VERBOSE}*1; |
708 | |
708 | |
709 | our @REGISTRY; |
709 | our @REGISTRY; |
|
|
710 | |
|
|
711 | our %PROTOCOL; # (ipv4|ipv6) => (1|2) |
|
|
712 | |
|
|
713 | { |
|
|
714 | my $idx; |
|
|
715 | $PROTOCOL{$_} = ++$idx |
|
|
716 | for split /\s*,\s*/, $ENV{PERL_ANYEVENT_PROTOCOLS} || "ipv4,ipv6"; |
|
|
717 | } |
710 | |
718 | |
711 | my @models = ( |
719 | my @models = ( |
712 | [EV:: => AnyEvent::Impl::EV::], |
720 | [EV:: => AnyEvent::Impl::EV::], |
713 | [Event:: => AnyEvent::Impl::Event::], |
721 | [Event:: => AnyEvent::Impl::Event::], |
714 | [Tk:: => AnyEvent::Impl::Tk::], |
722 | [Tk:: => AnyEvent::Impl::Tk::], |
… | |
… | |
1045 | Must be set to a comma-separated list of protocols or address families, |
1053 | Must be set to a comma-separated list of protocols or address families, |
1046 | current supported: C<ipv4> and C<ipv6>. Only protocols mentioned will be |
1054 | current supported: C<ipv4> and C<ipv6>. Only protocols mentioned will be |
1047 | used, and preference will be given to protocols mentioned earlier in the |
1055 | used, and preference will be given to protocols mentioned earlier in the |
1048 | list. |
1056 | list. |
1049 | |
1057 | |
|
|
1058 | This variable can effectively be used for denial-of-service attacks |
|
|
1059 | against local programs (e.g. when setuid), although the impact is likely |
|
|
1060 | small, as the program has to handle connection errors already- |
|
|
1061 | |
1050 | Examples: C<PERL_ANYEVENT_PROTOCOLS=ipv4,ipv6> - prefer IPv4 over IPv6, |
1062 | Examples: C<PERL_ANYEVENT_PROTOCOLS=ipv4,ipv6> - prefer IPv4 over IPv6, |
1051 | but support both and try to use both. C<PERL_ANYEVENT_PROTOCOLS=ipv4> |
1063 | but support both and try to use both. C<PERL_ANYEVENT_PROTOCOLS=ipv4> |
1052 | - only support IPv4, never try to resolve or contact IPv6 |
1064 | - only support IPv4, never try to resolve or contact IPv6 |
1053 | addressses. C<PERL_ANYEVENT_PROTOCOLS=ipv6,ipv4> support either IPv4 or |
1065 | addressses. C<PERL_ANYEVENT_PROTOCOLS=ipv6,ipv4> support either IPv4 or |
1054 | IPv6, but prefer IPv6 over IPv4. |
1066 | IPv6, but prefer IPv6 over IPv4. |
|
|
1067 | |
|
|
1068 | =item C<PERL_ANYEVENT_EDNS0> |
|
|
1069 | |
|
|
1070 | Used by L<AnyEvent::DNS> to decide wether to use the EDNS0 extension |
|
|
1071 | for DNS. This extension is generally useful to reduce DNS traffic, but |
|
|
1072 | some (broken) firewalls drop such DNS packets, which is why it is off by |
|
|
1073 | default. |
|
|
1074 | |
|
|
1075 | Setting this variable to C<1> will cause L<AnyEvent::DNS> to announce |
|
|
1076 | EDNS0 in its DNS requests. |
1055 | |
1077 | |
1056 | =back |
1078 | =back |
1057 | |
1079 | |
1058 | =head1 EXAMPLE PROGRAM |
1080 | =head1 EXAMPLE PROGRAM |
1059 | |
1081 | |