stas 2004/02/26 17:53:27
Modified: t/filter/TestFilter in_bbs_inject_header.pm Log: further optimization: push the reset requst output filter only if the server was configured to support keepalive connections Revision Changes Path 1.5 +8 -3 modperl-2.0/t/filter/TestFilter/in_bbs_inject_header.pm Index: in_bbs_inject_header.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_inject_header.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -u -r1.4 -r1.5 --- in_bbs_inject_header.pm 27 Feb 2004 01:23:32 -0000 1.4 +++ in_bbs_inject_header.pm 27 Feb 2004 01:53:26 -0000 1.5 @@ -31,6 +31,7 @@ use Apache::RequestRec (); use Apache::RequestIO (); use Apache::Connection (); +use Apache::Server (); use APR::Brigade (); use APR::Bucket (); use APR::Table (); @@ -113,9 +114,13 @@ # at this point we don't know whether the connection is going to # be keepalive or not, since the relevant input headers weren't # parsed yet. we know only after ap_http_header_filter was called. - # therefore we have no choice but to always add the flagging - # output filter - $filter->c->add_output_filter(\&flag_request_reset); + # therefore we have no choice but to add the flagging output filter + # unless we know that the server is configured not to allow + # keep_alive connections + my $s = $filter->c->base_server; + if ($s->keep_alive && $s->keep_alive_timeout > 0) { + $filter->c->add_output_filter(\&flag_request_reset); + } return Apache::OK; }