From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C10CC63381D for ; Mon, 29 Feb 2016 01:41:11 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/8] http: error check for sysseek on input Date: Mon, 29 Feb 2016 01:41:00 +0000 Message-Id: <20160229014107.7396-2-e@80x24.org> In-Reply-To: <20160229014107.7396-1-e@80x24.org> References: <20160229014107.7396-1-e@80x24.org> List-Id: Just in case we screwed up somewhere, we need to match up syswrite to sysseek and we also favor procedural calls for native types. --- lib/PublicInbox/HTTP.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 928c0f2..4d771f2 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -109,7 +109,7 @@ sub app_dispatch ($) { $host =~ s/:(\d+)\z// and $env->{SERVER_PORT} = $1; $env->{SERVER_NAME} = $host; } - $env->{'psgi.input'}->seek(0, SEEK_SET); + sysseek($env->{'psgi.input'}, 0, SEEK_SET) or die "input seek failed: $!"; my $res = Plack::Util::run_app($self->{httpd}->{app}, $env); eval { if (ref($res) eq 'CODE') { @@ -204,7 +204,7 @@ sub event_write { if ($self->{rbuf} eq '') { $self->watch_read(1); } else { - # avoid recursion + # avoid recursion for pipelined requests Danga::Socket->AddTimer(0, sub { rbuf_process($self) }); } } -- EW