]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: move LINE_MAX constant to the top
authorEric Wong <e@80x24.org>
Fri, 5 Jul 2019 22:53:37 +0000 (22:53 +0000)
committerEric Wong <e@80x24.org>
Sat, 6 Jul 2019 04:33:35 +0000 (04:33 +0000)
It'll be accessible from other places, and there was no real
point in having it declared inside a sub.

lib/PublicInbox/NNTP.pm

index 9b8b81ec66720ec959b7515d3d5e2a3929023508..631fd3c73f80329e5f01c889e956328854c795bc 100644 (file)
@@ -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;