Following patch fixes two things.
A) We were adding bad newlines after the content.
B) It is perfectly simple to do streaming by switching filter after we send out the
HTTP Request! This is now documented.
It probably would be possible to do something similar by allowing switching the filter
on end of header if you are receiving a large file. (To avoid having to read the
entire file into memory). If noone volunteers I will take a look at it.
Arthur
--- HTTPD.pm.old Thu Sep 6 13:08:49 2001
+++ HTTPD.pm Thu Sep 6 13:14:23 2001
@@ -180,8 +180,7 @@
push @result, $status_line;
push @result, $_->headers_as_string("\x0D\x0A"); # network newlines!
my $content = $_->content;
- push @result, $content if defined $content;
- push @raw, 'HTTP/1.0 ' . join("\x0D\x0A", @result, ""); # network newlines!
+ push @raw, 'HTTP/1.0 ' . join("\x0D\x0A", @result, "") . $content; # network
+newlines!
}
\@raw;
@@ -301,6 +300,19 @@
=head1 PUBLIC FILTER METHODS
Please see POE::Filter.
+
+
+=head1 Streaming Media
+
+It is perfectly possible to use Filter::HTTPD for streaming output media.
+Even if it is not possible to change the input filter from Filter::HTTPD,
+by setting the output_filter to Filter::Stream and omitting any content
+in the HTTP::Response object.
+
+ $wheel->put($response);
+ $wheel->set_output_filter(POE::Filter::Stream->new());
+ $wheel->put("Raw content);
+
=head1 SEE ALSO