]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwAtomStream.pm
view: start performing buffering into {obuf}
[public-inbox.git] / lib / PublicInbox / WwwAtomStream.pm
index 9ec1383dada276b101a35df7ea3809692609567e..d142a469c68b382331462c24ad0947e6c7184e8b 100644 (file)
@@ -23,7 +23,7 @@ sub new {
        my ($class, $ctx, $cb) = @_;
        $ctx->{emit_header} = 1;
        $ctx->{feed_base_url} = $ctx->{-inbox}->base_url($ctx->{env});
-       bless { cb => $cb || *close, ctx => $ctx }, $class;
+       bless { cb => $cb || \&close, ctx => $ctx }, $class;
 }
 
 sub response {
@@ -140,9 +140,11 @@ sub feed_entry {
                "<id>$uuid</id>$irt" .
                qq{<content\ntype="xhtml">} .
                qq{<div\nxmlns="http://www.w3.org/1999/xhtml">} .
-               qq(<pre\nstyle="white-space:pre-wrap">) .
-               PublicInbox::View::multipart_text_as_html($mime, $href, $ctx) .
-               '</pre></div></content></entry>';
+               qq(<pre\nstyle="white-space:pre-wrap">);
+       $ctx->{obuf} = \$s;
+       PublicInbox::View::multipart_text_as_html($mime, $href, $ctx);
+       delete $ctx->{obuf};
+       $s .= '</pre></div></content></entry>';
 }
 
 sub feed_updated {