From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-5.4 required=3.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD,URIBL_BLOCKED shortcircuit=no autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 19AEC1FCB3 for ; Sun, 22 May 2016 06:17:30 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] http: pass reference to Danga::Socket::write Date: Sun, 22 May 2016 06:17:30 +0000 Message-Id: <20160522061730.7884-2-e@80x24.org> In-Reply-To: <20160522061730.7884-1-e@80x24.org> References: <20160521234527.21133-1-e@80x24.org> <20160522061730.7884-1-e@80x24.org> List-Id: This can avoid an expensive copy for big strings. --- lib/PublicInbox/HTTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 6576bf6..4eb1448 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