Return-Path: Delivered-To: apmail-httpd-test-cvs-archive@www.apache.org Received: (qmail 85784 invoked from network); 5 Aug 2004 07:00:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 5 Aug 2004 07:00:16 -0000 Received: (qmail 40581 invoked by uid 500); 5 Aug 2004 07:00:15 -0000 Delivered-To: apmail-httpd-test-cvs-archive@httpd.apache.org Received: (qmail 40515 invoked by uid 500); 5 Aug 2004 07:00:14 -0000 Mailing-List: contact test-cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-cvs@httpd.apache.org Received: (qmail 40484 invoked by uid 99); 5 Aug 2004 07:00:14 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 05 Aug 2004 00:00:11 -0700 Received: (qmail 85734 invoked by uid 1072); 5 Aug 2004 07:00:10 -0000 Date: 5 Aug 2004 07:00:10 -0000 Message-ID: <20040805070010.85733.qmail@minotaur.apache.org> From: stas@apache.org To: httpd-test-cvs@apache.org Subject: cvs commit: httpd-test/perl-framework/Apache-Test Changes X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N stas 2004/08/05 00:00:10 Modified: perl-framework/Apache-Test/lib/Apache TestCommonPost.pm perl-framework/Apache-Test Changes Log: fix Apache::TestCommonPost::lwp_do to work with LWP 5.800 ($res->content() doesn't allow CODE refs anymore, instead used content_ref to avoid huge strings copy) Revision Changes Path 1.4 +21 -11 httpd-test/perl-framework/Apache-Test/lib/Apache/TestCommonPost.pm Index: TestCommonPost.pm =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestCommonPost.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -u -r1.3 -r1.4 --- TestCommonPost.pm 4 Mar 2004 05:51:31 -0000 1.3 +++ TestCommonPost.pm 5 Aug 2004 07:00:09 -0000 1.4 @@ -65,20 +65,30 @@ sub lwp_do { my $length = shift; - my $remain = $length; - - use constant BUF_SIZE => 8192; - - my $content = sub { - my $bytes = $remain < BUF_SIZE ? $remain : BUF_SIZE; - my $buf = 'a' x $bytes; - $remain -= $bytes; - $buf; - }; my $request = HTTP::Request->new(POST => $Location); $request->header('Content-length' => $length); - $request->content($content); + + if (LWP->VERSION >= 5.800) { + $request->content_ref(\('a' x $length)); + } else { + # before LWP 5.800 there was no way to tell HTTP::Message not + # to copy the string, there is a settable content_ref since + # 5.800 + use constant BUF_SIZE => 8192; + + my $remain = $length; + my $content = sub { + my $bytes = $remain < BUF_SIZE ? $remain : BUF_SIZE; + my $buf = 'a' x $bytes; + $remain -= $bytes; + $buf; + }; + + $request->content($content); + } + + my $response = $UA->request($request); 1.155 +4 -0 httpd-test/perl-framework/Apache-Test/Changes Index: Changes =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v retrieving revision 1.154 retrieving revision 1.155 diff -u -u -r1.154 -r1.155 --- Changes 4 Aug 2004 15:26:48 -0000 1.154 +++ Changes 5 Aug 2004 07:00:10 -0000 1.155 @@ -8,6 +8,10 @@ =item 1.13-dev +fix Apache::TestCommonPost::lwp_do to work with LWP 5.800 +($res->content() doesn't allow CODE refs anymore, instead used +content_ref to avoid huge strings copy) [Stas] + add @PHP_MODULE@ extra.conf.in substitution variable, which selects mod_php4 or mod_php5 as appropriate. [Geoffrey Young]