Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / libwww-perl / libwww-perl-5.813 / lib / LWP / Protocol / loopback.pm
diff --git a/dev/i386/libwww-perl/libwww-perl-5.813/lib/LWP/Protocol/loopback.pm b/dev/i386/libwww-perl/libwww-perl-5.813/lib/LWP/Protocol/loopback.pm
new file mode 100644 (file)
index 0000000..2cd67ae
--- /dev/null
@@ -0,0 +1,26 @@
+package LWP::Protocol::loopback;
+
+use strict;
+use vars qw(@ISA);
+require HTTP::Response;
+
+require LWP::Protocol;
+@ISA = qw(LWP::Protocol);
+
+sub request {
+    my($self, $request, $proxy, $arg, $size, $timeout) = @_;
+
+    my $response = HTTP::Response->new(200, "OK");
+    $response->content_type("message/http; msgtype=request");
+
+    $response->header("Via", "loopback/1.0 $proxy")
+       if $proxy;
+
+    $response->header("X-Arg", $arg);
+    $response->header("X-Read-Size", $size);
+    $response->header("X-Timeout", $timeout);
+
+    return $self->collect_once($arg, $response, $request->as_string);
+}
+
+1;