From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AAB841F4B7 for ; Fri, 5 Jul 2019 22:53:39 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/4] nntp: move LINE_MAX constant to the top Date: Fri, 5 Jul 2019 22:53:37 +0000 Message-Id: <20190705225339.5698-3-e@80x24.org> In-Reply-To: <20190705225339.5698-1-e@80x24.org> References: <20190705225339.5698-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It'll be accessible from other places, and there was no real point in having it declared inside a sub. --- lib/PublicInbox/NNTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 9b8b81ec..631fd3c7 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -18,6 +18,7 @@ PublicInbox::DS->import(qw(now)); use Digest::SHA qw(sha1_hex); use Time::Local qw(timegm timelocal); use constant { + LINE_MAX => 512, # RFC 977 section 2.3 r501 => '501 command syntax error', r221 => '221 Header follows', r224 => '224 Overview information follows (multi-line)', @@ -954,7 +955,6 @@ sub event_step { # only read more requests if we've drained the write buffer, # otherwise we can be buffering infinitely w/o backpressure - use constant LINE_MAX => 512; # RFC 977 section 2.3 my $rbuf = $self->{rbuf} // (\(my $x = '')); my $r = 1; -- EW