Changeset 13805

Show
Ignore:
Timestamp:
06/13/08 13:54:04 (6 years ago)
Author:
nothingmuch
Message:

r82914@syeeda (orig r13794): tokuhirom | 2008-06-13 07:17:36 +0400
oops. i forgot to commit :-(
r82915@syeeda (orig r13795): tokuhirom | 2008-06-13 07:17:55 +0400
please test in deep.

Location:
lang/perl/HTTP-Engine/branches/lazy_request
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-Engine/branches/lazy_request/Makefile.PL

    r13792 r13805  
    7474    Apache::TestMM::filter_args(); 
    7575    Apache::TestMM::generate_script('t/TEST'); 
    76     tests('t/*.t t/modperl/basic.t'); 
     76    tests('t/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t t/modperl/basic.t'); 
     77} else { 
     78    tests('t/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t'); 
    7779} 
    7880 
  • lang/perl/HTTP-Engine/branches/lazy_request/lib/HTTP/Engine/Interface/POE.pm

    r13792 r13805  
    3535        ClientFilter => 'POE::Filter::HTTPD', 
    3636        ( $self->alias ? ( Alias => $self->alias ) : () ), 
    37         ClientInput  => sub { 
    38             my ( $kernel, $heap, $request ) = @_[ KERNEL, HEAP, ARG0 ]; 
     37        ClientInput  => _client_input($self), 
     38    ); 
     39} 
    3940 
    40             # Filter::HTTPD sometimes generates HTTP::Response objects. 
    41             # They indicate (and contain the response for) errors that occur 
    42             # while parsing the client's HTTP request.  It's easiest to send 
    43             # the responses as they are and finish up. 
    44             if ( $request->isa('HTTP::Response') ) { 
    45                 $heap->{client}->put($request); 
    46                 $kernel->yield('shutdown'); 
    47                 return; 
    48             } 
     41sub _client_input { 
     42    my $self = shift; 
    4943 
    50             # follow is normal workflow. 
    51             my $ascgi = HTTP::Request::AsCGI->new($request)->setup; 
    52             do { 
    53                 $self->handle_request(); 
    54             }; 
    55             $ascgi->restore; 
     44    sub { 
     45        my ( $kernel, $heap, $request ) = @_[ KERNEL, HEAP, ARG0 ]; 
    5646 
    57             $heap->{client}->put($ascgi->response); 
     47        # Filter::HTTPD sometimes generates HTTP::Response objects. 
     48        # They indicate (and contain the response for) errors that occur 
     49        # while parsing the client's HTTP request.  It's easiest to send 
     50        # the responses as they are and finish up. 
     51        if ( $request->isa('HTTP::Response') ) { 
     52            $heap->{client}->put($request); 
    5853            $kernel->yield('shutdown'); 
    59         }, 
    60     ); 
     54            return; 
     55        } 
     56 
     57        # follow is normal workflow. 
     58        my $ascgi = HTTP::Request::AsCGI->new($request)->setup; 
     59        do { 
     60            $self->handle_request(); 
     61        }; 
     62        $ascgi->restore; 
     63 
     64        $heap->{client}->put($ascgi->response); 
     65        $kernel->yield('shutdown'); 
     66    } 
    6167} 
    6268