… | |
… | |
881 | $self->parse_resolv_conf (<$fh>); |
881 | $self->parse_resolv_conf (<$fh>); |
882 | } |
882 | } |
883 | } |
883 | } |
884 | } |
884 | } |
885 | |
885 | |
|
|
886 | =item $resolver->timeout ($timeout, ...) |
|
|
887 | |
|
|
888 | Sets the timeout values. See the C<timeout> constructor argument (and note |
|
|
889 | that this method uses the values itselt, not an array-reference). |
|
|
890 | |
|
|
891 | =cut |
|
|
892 | |
|
|
893 | sub timeout { |
|
|
894 | my ($self, @timeout) = @_; |
|
|
895 | |
|
|
896 | $self->{timeout} = \@timeout; |
|
|
897 | $self->_compile; |
|
|
898 | } |
|
|
899 | |
|
|
900 | =item $resolver->max_outstanding ($nrequests) |
|
|
901 | |
|
|
902 | Sets the maximum number of outstanding requests to C<$nrequests>. See the |
|
|
903 | C<max_outstanding> constructor argument. |
|
|
904 | |
|
|
905 | =cut |
|
|
906 | |
|
|
907 | sub max_outstanding { |
|
|
908 | my ($self, $max) = @_; |
|
|
909 | |
|
|
910 | $self->{max_outstanding} = $max; |
|
|
911 | $self->_scheduler; |
|
|
912 | } |
|
|
913 | |
886 | sub _compile { |
914 | sub _compile { |
887 | my $self = shift; |
915 | my $self = shift; |
888 | |
916 | |
889 | my %search; $self->{search} = [grep 0 < length, grep !$search{$_}++, @{ $self->{search} }]; |
917 | my %search; $self->{search} = [grep 0 < length, grep !$search{$_}++, @{ $self->{search} }]; |
890 | my %server; $self->{server} = [grep 0 < length, grep !$server{$_}++, @{ $self->{server} }]; |
918 | my %server; $self->{server} = [grep 0 < length, grep !$server{$_}++, @{ $self->{server} }]; |