From 31afda256c813443062e0504213d41732e50ee45 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 12 Jun 2016 04:46:38 +0000 Subject: view: msg_html uses getline body to reduce latency We need to ensure we show the message body ASAP since the thread generation via Xapian could take a while and maybe even raise an exception or crash. --- t/view.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/view.t b/t/view.t index 3332fb48..6c085991 100644 --- a/t/view.t +++ b/t/view.t @@ -9,7 +9,13 @@ use PublicInbox::View; sub msg_html ($) { my ($mime) = @_; - PublicInbox::View::msg_html(undef, $mime); + my $s = ''; + my $body = PublicInbox::View::msg_html(undef, $mime); + while (defined(my $buf = $body->getline)) { + $s .= $buf; + } + $body->close; + $s; } # plain text -- cgit v1.2.3-24-ge0c7