ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.125 by root, Fri May 23 23:37:13 2008 UTC vs.
Revision 1.127 by root, Sat May 24 01:15:19 2008 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines