From d644f8903b8dd4f9765fd0f88cc8e0d9fa5f6a5e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 22 May 2016 06:17:30 +0000 Subject: http: pass reference to Danga::Socket::write This can avoid an expensive copy for big strings. --- lib/PublicInbox/HTTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/HTTP.pm') 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 -- cgit v1.2.3-24-ge0c7