dougm 02/04/01 19:34:49
Modified: perl-framework/Apache-Test/lib/Apache TestRequest.pm
Log:
move lwp tracing code into lwp_trace function so it can be called elsewhere
Revision Changes Path
1.68 +20 -16
httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
Index: TestRequest.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- TestRequest.pm 2 Apr 2002 01:42:13 -0000 1.67
+++ TestRequest.pm 2 Apr 2002 03:34:49 -0000 1.68
@@ -350,6 +350,25 @@
}
}
+sub lwp_trace {
+ my $r = shift;
+
+ unless ($r->request->protocol) {
+ #lwp always sends a request, but never sets
+ #$r->request->protocol, happens deeper in the
+ #LWP::Protocol::http* modules
+ my $proto = user_agent_request_num($r) ? "1.1" : "1.0";
+ $r->request->protocol("HTTP/$proto");
+ }
+
+ my $want_body = $DebugLWP > 1;
+ print "#lwp request:\n",
+ lwp_as_string($r->request, $want_body);
+
+ print "#server response:\n",
+ lwp_as_string($r, $want_body);
+}
+
sub lwp_call {
my($name, $shortcut) = (shift, shift);
@@ -371,22 +390,7 @@
}
if ($DebugLWP and not $shortcut) {
- my($url, @rest) = @_;
-
- unless ($r->request->protocol) {
- #lwp always sends a request, but never sets
- #$r->request->protocol, happens deeper in the
- #LWP::Protocol::http* modules
- my $proto = user_agent_request_num($r) ? "1.1" : "1.0";
- $r->request->protocol("HTTP/$proto");
- }
-
- my $want_body = $DebugLWP > 1;
- print "#lwp request:\n",
- lwp_as_string($r->request, $want_body);
-
- print "#server response:\n",
- lwp_as_string($r, $want_body);
+ lwp_trace($r);
}
die $error if $error;