Show
Ignore:
Timestamp:
04/25/08 09:42:57 (7 years ago)
Author:
daisuke
Message:

configはどこにいくんでしょうね。とりあえず動くようにしてみた

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTPEx-Adaptor-ModPerl/trunk/lib/HTTPEx/Adaptor/ModPerl.pm

    r10382 r10393  
    1111use URI::https; 
    1212 
     13use Apache2::Connection; 
     14use Apache2::RequestRec; 
     15use Apache2::RequestUtil; 
     16use APR::Table; 
     17 
    1318use constant MP2 => ( 
    1419    exists $ENV{MOD_PERL_API_VERSION} and 
     
    6267    my ( $self, $adaptor, $c ) = @_; 
    6368 
    64     $c->request->address( $self->apache->connection->remote_ip ); 
     69    my $apache = $self->apache; 
     70    my $config = $self->config; 
     71 
     72    $c->request->address( $apache->connection->remote_ip ); 
    6573 
    6674    PROXY_CHECK: 
    6775    { 
    68         my $headers = $self->apache->headers_in; 
    69         unless ( $c->config->{using_frontend_proxy} ) { 
     76        my $headers = $apache->headers_in; 
     77        unless ( $config->{using_frontend_proxy} ) { 
    7078            last PROXY_CHECK if $c->request->address ne '127.0.0.1'; 
    71             last PROXY_CHECK if $c->config->{ignore_frontend_proxy}; 
     79            last PROXY_CHECK if $config->{ignore_frontend_proxy}; 
    7280        }         
    7381        last PROXY_CHECK unless $headers->{'X-Forwarded-For'}; 
     
    8795        $c->request->secure(1) if $self->apache->connection->is_https; 
    8896    } else { 
    89         my $https = $self->apache->subprocess_env('HTTPS');  
     97        my $https = $apache->subprocess_env('HTTPS');  
    9098        $c->request->secure(1) if defined $https and uc $https eq 'ON'; 
    9199    } 
     
    115123    my ( $self, $adaptor, $c ) = @_; 
    116124 
     125    my $apache = $self->apache; 
     126    my $config = $self->config; 
     127 
    117128    my $scheme = $c->request->secure ? 'https' : 'http'; 
    118     my $host   = $self->apache->hostname || 'localhost'; 
    119     my $port   = $self->apache->get_server_port; 
     129    my $host   = $apache->hostname || 'localhost'; 
     130    my $port   = $apache->get_server_port; 
    120131 
    121132    # If we are running as a backend proxy, get the true hostname 
    122133    PROXY_CHECK: 
    123134    { 
    124         unless ( $c->config->{using_frontend_proxy} ) { 
     135        unless ( $config->{using_frontend_proxy} ) { 
    125136            last PROXY_CHECK if $host !~ /localhost|127.0.0.1/; 
    126             last PROXY_CHECK if $c->config->{ignore_frontend_proxy}; 
     137            last PROXY_CHECK if $config->{ignore_frontend_proxy}; 
    127138        } 
    128139        last PROXY_CHECK unless $c->request->header( 'X-Forwarded-Host' ); 
     
    143154 
    144155    # Are we running in a non-root Location block? 
    145     my $location = $self->apache->location; 
     156    my $location = $apache->location; 
    146157    if ( $location && $location ne '/' ) { 
    147158        $base_path = $location; 
     
    161172     
    162173    if ( MP2 ) { 
    163         ($path, $qs) = split /\?/, $self->apache->unparsed_uri, 2; 
     174        ($path, $qs) = split /\?/, $apache->unparsed_uri, 2; 
    164175    } 
    165176    else { 
    166         my (undef, $path_query) = split / /, $self->apache->the_request, 3; 
     177        my (undef, $path_query) = split / /, $apache->the_request, 3; 
    167178        ($path, $qs)            = split /\?/, $path_query, 2; 
    168179    } 
     
    170181    # Don't check for LocationMatch blocks if requested 
    171182    # http://rt.cpan.org/Ticket/Display.html?id=26921 
    172     if ( $self->apache->dir_config('CatalystDisableLocationMatch') ) { 
     183    if ( $apache->dir_config('HTTPEngineDisableLocationMatch') ) { 
    173184        $base_path = ''; 
    174185    } 
     
    194205    # this way is beyond me, but we'll support it! 
    195206    # XXX: This needs a test 
    196     if ( defined $ENV{SCRIPT_NAME} && $self->apache->filename && -f $self->apache->filename && -x _ ) { 
     207    if ( defined $ENV{SCRIPT_NAME} && $apache->filename && -f $apache->filename && -x _ ) { 
    197208        $base_path .= $ENV{SCRIPT_NAME}; 
    198209    }