about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-05-22 06:17:30 +0000
committerEric Wong <e@80x24.org>2016-05-22 07:28:19 +0000
commitd644f8903b8dd4f9765fd0f88cc8e0d9fa5f6a5e (patch)
tree17ad86aebc19ede995f7342c4470aa6ae72f6ebc
parent5fd049f32fde94f53f431ae3f37143440ee0cf09 (diff)
downloadpublic-inbox-d644f8903b8dd4f9765fd0f88cc8e0d9fa5f6a5e.tar.gz
This can avoid an expensive copy for big strings.
-rw-r--r--lib/PublicInbox/HTTP.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index 6576bf68..4eb14481 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -200,7 +200,7 @@ sub response_write {
         my $alive = response_header_write($self, $env, $res);
 
         # middlewares such as Deflater may write empty strings
-        my $write = sub { $self->write($_[0]) if $_[0] ne '' };
+        my $write = sub { $self->write(\($_[0])) if $_[0] ne '' };
         my $close = sub {
                 if ($alive) {
                         $self->event_write; # watch for readability if done